private void Awake() { Instance = this; cancerRoot = transform; cancerMap = new bool[_size.x, _size.y]; _idleTiles = new List <Vector2Int>(cancerMap.Length); _busyTiles = new List <Vector2Int>(cancerMap.Length); prototypes.Add("Cancer 0", Resources.Load <GameObject>("Prefabs/Cancer 0")); prototypes.Add("Cancer 1", Resources.Load <GameObject>("Prefabs/Cancer 1")); prototypes.Add("Cancer 2", Resources.Load <GameObject>("Prefabs/Cancer 2")); }
private void Die() { _isAlive = false; ExplosionController explosion = ExplosionManager.Get(explodeEffect); explosion.transform.position = transform.position; explosion.Explode(); if (explodeSound) { AudioManager.PlayAtPoint(explodeSound, transform.position); } CancerManager.Recycle(this); GameSceneController.OnCancerDeath(identifierName); }
public void Replay() { EnemyManager.Reset(); ParticleDecalManager.Reset(); ExplosionManager.Reset(); BulletController[] bullets = FindObjectsOfType <BulletController>(); foreach (var bullet in bullets) { bullet.Recycle(); } ParticleController[] particles = FindObjectsOfType <ParticleController>(); foreach (var particle in particles) { ParticleManager.Recycle(particle); } CancerController[] cancers = FindObjectsOfType <CancerController>(); foreach (var cancer in cancers) { CancerManager.Recycle(cancer); } CancerManager.Instance.Deactivate(); Play(); }