void Start() { prefab = transform.GetChild(0); prefab.gameObject.SetActive(false); pool = new TrPool <GodRayTr>(prefab); ps = new List <GodRayTr>(); }
private void Awake() { foreach (Transform item in wall) { item.GetComponent <SpriteRenderer>().enabled = false; } pools = new Dictionary <Type, TrPool <Pobject> >(); var p = new TrPool <Pobject>(Resources.Load <Transform>("prefab/zk"), 50); p.repa = poolpa; pools.Add(typeof(ZKobject), p); p = new TrPool <Pobject>(Resources.Load <Transform>("prefab/fireboll"), 50); p.repa = poolpa; pools.Add(typeof(Ball), p); p = new TrPool <Pobject>(Resources.Load <Transform>("prefab/zd"), 5); p.repa = poolpa; pools.Add(typeof(ZDobject), p); //MVC.OnApplicationFocus += OnApplicationFocus; }
public void Start() { menu.Add("场景管理"); menu.Set(0, false); menu.onValueChanged.AddListener(OnClickMenu); pool = new TrPool <UIItem>(prefab); prefab.gameObject.SetActive(false); myuiitem = new List <UIItem>(); search.onValueChanged.AddListener(Search); sea.onClick.AddListener(() => { var se = GameApp.Ins.GetControllerCompent <GameObject>("sea"); if (se) { foreach (Transform item in se.transform) { item.gameObject.SetActive(!item.gameObject.activeSelf); } } }); }