using System.Collections; using System.Collections.Generic; using UnityEngine; using ZXKFramework; using System; public class InsectPinModel : MonoBehaviour { public GameObject[] True; public GameObject[] False; public Action CBClick; //public Action CBFalse; public void Begin() { foreach (GameObject isT in True) { isT.SetActive(true); isT.GetComponent().down = DoTrue; } foreach (GameObject isF in False) { isF.SetActive(true); isF.GetComponent().down = DoFalse; } } public void End() { foreach (GameObject isT in True) { isT.GetComponent().down = null; isT.SetActive(false); } foreach (GameObject isF in False) { isF.GetComponent().down = null; isF.SetActive(false); } } void DoTrue(GameObject t) { End(); CBClick.Invoke(true); } void DoFalse(GameObject f) { CBClick.Invoke(false); return; } // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } }