Beispiel #1
0
        public void OnInstantiate(int prefabIndex, PrefabsPool <NpcBubble> pool)
        {
            PrefabIndex = prefabIndex;

            this.pool = pool;

            base.Init();
        }
Beispiel #2
0
 public static PrefabsPool GetInstance()
 {
     if(null == _Instance)
     {
         _Instance = new PrefabsPool();
     }
     return _Instance;
 }
Beispiel #3
0
        void Start()
        {
            gameOverPopup.Init(this);

            shell.Init();
            shell.RadiusChange += OnShellRadiusChange;

            npcBubblePool           = new PrefabsPool <NpcBubble>(npcBubblePrefabs, transform, 3);
            npcBubblePool.Recycled += OnNpcRecycled;

            Reset();
        }
Beispiel #4
0
    public void Load()
    {
        if (prefabPlayerDisplay != null &&
            containerPlayerDisplay != null)
        {
            containerPlayerDisplay.DestroyChildren();

            GameObject go = PrefabsPool.Instantiate(prefabPlayerDisplay) as GameObject;

            if (go != null)
            {
                go.transform.parent = containerPlayerDisplay.transform;

                go.ResetObject();

                go.SetLayerRecursively(gameObject.layer);

                UpdatePlayers();
            }
        }
    }