public GameObject GetMonsterFromName(string monsterName) { ObjectPool pool; if (_monstersPools.TryGetValue(monsterName, out pool)) { var monster = pool.GetObject(); monster.SetActive(true); return(monster); } return(SpiderPool.GetObject()); }
private void Awake() { var caveObject = new GameObject("Caves"); _cave = caveObject.AddComponent <CaveHandler>(); _shrooms = new ShroomPool(); _stals = new StalPool(); _moths = new MothPool(); _spiders = new SpiderPool(); _webs = new WebPool(); _triggers = new TriggerHandler(); _npcs = new NPCPool(); }
void Start() { //Debug.Log("Colored Objects Manager created"); player1ShotPools[0] = rsc.poolMng.player1ShotRedPool; player1ShotPools[1] = rsc.poolMng.player1ShotGreenPool; player1ShotPools[2] = rsc.poolMng.player1ShotBluePool; player1ShotPools[3] = rsc.poolMng.player1ShotYellowPool; player2ShotPools[0] = rsc.poolMng.player2ShotRedPool; player2ShotPools[1] = rsc.poolMng.player2ShotGreenPool; player2ShotPools[2] = rsc.poolMng.player2ShotBluePool; player2ShotPools[3] = rsc.poolMng.player2ShotYellowPool; playerMuzzlePools[0] = rsc.poolMng.playerMuzzleRedPool; playerMuzzlePools[1] = rsc.poolMng.playerMuzzleGreenPool; playerMuzzlePools[2] = rsc.poolMng.playerMuzzleBluePool; playerMuzzlePools[3] = rsc.poolMng.playerMuzzleYellowPool; playerDashPools[0] = rsc.poolMng.playerDashRedPool; playerDashPools[1] = rsc.poolMng.playerDashGreenPool; playerDashPools[2] = rsc.poolMng.playerDashBluePool; playerDashPools[3] = rsc.poolMng.playerDashYellowPool; spiderPool = rsc.poolMng.spiderPool; mosquitoPool = rsc.poolMng.mosquitoPool; mosquitoWeakShotPools[0] = rsc.poolMng.mosquitoWeakShotRedPool; mosquitoWeakShotPools[1] = rsc.poolMng.mosquitoWeakShotGreenPool; mosquitoWeakShotPools[2] = rsc.poolMng.mosquitoWeakShotBluePool; mosquitoWeakShotPools[3] = rsc.poolMng.mosquitoWeakShotYellowPool; turretMuzzlePools[0] = rsc.poolMng.turretMuzzleRedPool; turretMuzzlePools[1] = rsc.poolMng.turretMuzzleGreenPool; turretMuzzlePools[2] = rsc.poolMng.turretMuzzleBluePool; turretMuzzlePools[3] = rsc.poolMng.turretMuzzleYellowPool; voxelPool = rsc.poolMng.voxelPool; rsc.eventMng.StartListening(EventManager.EventType.COLOR_CHANGED, ColorChanged); currentColor = rsc.colorMng.CurrentColor; SetCurrentMaterials(); }
private void Awake() { Instance = this; }