public void Push(Vector3 direction, float force) { if (!_isPushed) { CoroutineLauncher.Start(PushTranslate(direction, force)); _isPushed = true; } }
public void Spawn(Vector3 from, Vector3 to) { float meteorSize = _projectileSpawner.ElementSize; float distance = Vector3.Distance(from, to); int meteorsCount = (int)Mathf.Min(distance / meteorSize, _meteorsCount); CoroutineLauncher.Start(PerformSpawn(from, to, meteorsCount)); }
public void Spawn(Vector3 position, Vector3 direction) { if (!SpaceDetector.IsFreeSpace(position, ElementSize / 2f)) { return; } var spawnPosition = FindSpawnPoint(position, direction); var projectile = MonoBehaviour.Instantiate( _prefab, spawnPosition, Quaternion.identity, _projectilesParent.transform); CoroutineLauncher.Start(DelayedLaunch(projectile, direction)); }
public override void Enter() { _shield = _data.Shield; if (_shield != null) { CoroutineLauncher.Start(DestroyShield()); } else { SwitchState(typeof(ChasingState)); } }
private static void TrySpawnShield(ShieldAnchors[] anchorsArray) { if (_isCooldown || anchorsArray == null) { return; } foreach (ShieldAnchors anchors in anchorsArray) { _shieldSpawner.Spawn(anchors.StartPoint.position, anchors.EndPoint.position); } CoroutineLauncher.Start(WaitCooldown(GameSettings.Instance.MavkaShieldsCooldownTime)); }
public override void Enter() { CoroutineLauncher.Start(CastProjectiles()); }
private void Create() { coroutineLauncher = this.Create <CoroutineLauncher>("Coroutine"); input = this.Create <Input>("Input"); }
protected override void PerformOnDie() { CoroutineLauncher.Start(ReloadScene()); }
public override void Enter() { CoroutineLauncher.Start(WaitForCooldown()); }
protected void PerformOnCastSpell() { Player.Instance.Mana.Remove(_manaAmount); CoroutineLauncher.Start(WaitCooldown()); }
public void StopRecover() => CoroutineLauncher.Stop(Recover());
public void StartRecover() => CoroutineLauncher.Start(Recover());
public override void Exit() { CoroutineLauncher.Stop(DestroyShield()); }
public void StartDraw() { CoroutineLauncher.Start(Draw()); }