Exemple #1
0
 void Start()
 {
     prefab = transform.GetChild(0);
     prefab.gameObject.SetActive(false);
     pool = new TrPool <GodRayTr>(prefab);
     ps   = new List <GodRayTr>();
 }
Exemple #2
0
    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;
    }
Exemple #3
0
 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);
             }
         }
     });
 }