public void Initialization() { _spawnObstacle = Object.FindObjectOfType <SpawnObstacle>(); _spawnZombie = Object.FindObjectOfType <SpawnZombie>(); _timeToSpawn = new TimeRemaining(SpawnTarget, Random.Range(_minDelay, _maxDelay), true); _timeToSpawn.AddTimeRemaining(); }
public void OnStart() { wave = new List <Wave>(); countWave = MainController.Instance.WavesSatting.CountWave; for (int i = 0; i < countWave; i++) { wave.Add(new Wave()); delayWave += wave[i].DelayWave; spawnInvoker = new TimeRemaining(wave[i].CreateWave, delayWave); spawnInvoker.AddTimeRemaining(); CountEnemy += wave[i].CountEnemy; } }
public void Shoot() { if (Time.timeScale != 0) { if (_iCanShoot) { var bullet = Instantiate(_bulletPrefab, _bulletStartPoint.position, Quaternion.identity); bullet.Move(_forceBullet); _iCanShoot = false; _timeToNextShoot.AddTimeRemaining(); } } }
public override void Use() { base.Use(); Services.Instance.LevelService.CharacterBehaviour.SnakeSpeed += _speed; _spawnInvoker.AddTimeRemaining(); }