public void OnInstantiate(int prefabIndex, PrefabsPool <NpcBubble> pool) { PrefabIndex = prefabIndex; this.pool = pool; base.Init(); }
public static PrefabsPool GetInstance() { if(null == _Instance) { _Instance = new PrefabsPool(); } return _Instance; }
void Start() { gameOverPopup.Init(this); shell.Init(); shell.RadiusChange += OnShellRadiusChange; npcBubblePool = new PrefabsPool <NpcBubble>(npcBubblePrefabs, transform, 3); npcBubblePool.Recycled += OnNpcRecycled; Reset(); }
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(); } } }