void StartGhostSpawners() { foreach (GhostInfo ghostInfo in ghostData) { ChaserSpawner spawner = gameObject.AddComponent <ChaserSpawner>() as ChaserSpawner; spawner.chaserObject = ghostObject; spawner.spawnPosition = ghostInfo.spawnPoint; spawner.spawnTurnDelay = ghostInfo.turnDelay; spawner.actionHistory = ghostInfo.actionHistory; } }
void Spawn() { if (Managers.Level == null) { return; } //position at spawn point gameObject.transform.position = Managers.Level.PlayerSpawn; //reveal the area Managers.Fog.Explore(gameObject.transform.position, exploreRateOnSpawn); //add chaser spawner ChaserSpawner spawner = gameObject.AddComponent <ChaserSpawner>() as ChaserSpawner; spawner.chaserObject = Managers.Level.monkeyObject; spawner.spawnTurnDelay = Managers.Level.monkeySpawnTurnDelay; }