Exemplo n.º 1
0
 public void Push(Vector3 direction, float force)
 {
     if (!_isPushed)
     {
         CoroutineLauncher.Start(PushTranslate(direction, force));
         _isPushed = true;
     }
 }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        public override void Enter()
        {
            _shield = _data.Shield;

            if (_shield != null)
            {
                CoroutineLauncher.Start(DestroyShield());
            }
            else
            {
                SwitchState(typeof(ChasingState));
            }
        }
Exemplo n.º 5
0
    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());
 }
Exemplo n.º 7
0
 private void Create()
 {
     coroutineLauncher = this.Create <CoroutineLauncher>("Coroutine");
     input             = this.Create <Input>("Input");
 }
Exemplo n.º 8
0
 protected override void PerformOnDie()
 {
     CoroutineLauncher.Start(ReloadScene());
 }
Exemplo n.º 9
0
 public override void Enter()
 {
     CoroutineLauncher.Start(WaitForCooldown());
 }
Exemplo n.º 10
0
 protected void PerformOnCastSpell()
 {
     Player.Instance.Mana.Remove(_manaAmount);
     CoroutineLauncher.Start(WaitCooldown());
 }
Exemplo n.º 11
0
 public void StopRecover() => CoroutineLauncher.Stop(Recover());
Exemplo n.º 12
0
 public void StartRecover() => CoroutineLauncher.Start(Recover());
Exemplo n.º 13
0
 public override void Exit()
 {
     CoroutineLauncher.Stop(DestroyShield());
 }
Exemplo n.º 14
0
 public void StartDraw()
 {
     CoroutineLauncher.Start(Draw());
 }