Exemple #1
0
 protected override void OnAbilityEnded(AbilityEnded e)
 {
     if (e.ability == Context)
     {
         EndPull();
     }
 }
    private IEnumerator Attack(AttackState state)
    {
        var spawned = Instantiate(_shuriken);

        spawned.Init(state.Rigidbody.velocity, _attackForce);
        yield return(new WaitForSeconds(_usefulTime));

        Reset();
        AbilityEnded?.Invoke();
    }
Exemple #3
0
 protected virtual void OnAbilityEnded(AbilityEnded e)
 {
     if (e.ability == Context)
     {
         if (Context.parentPlayer.stunned)
         {
             EndPull();
         }
     }
 }
Exemple #4
0
 void OnAbilityEnded(AbilityEnded e)
 {
     if (e.ability == pull && hookedPlayer == null)
     {
         SetStatus(TaskStatus.Aborted);
     }
     if (e.ability == pull && e.ability.parentPlayer.GetComponent <Player>().stunned)
     {
         SetStatus(TaskStatus.Aborted);
     }
 }
    IEnumerator Attack(AttackState state)
    {
        state.Rigidbody.velocity = Vector3.zero;

        yield return(new WaitForSeconds(_attackDelay));

        SpawnShuriken(state);

        _coroutine = null;
        AbilityEnded?.Invoke();
    }
Exemple #6
0
    private IEnumerator Attack(AttackState state)
    {
        float time = _usefulTime;

        while (time > 0)
        {
            state.Rigidbody.velocity = state.Rigidbody.velocity.normalized * _attackForce;
            time -= Time.deltaTime;
            yield return(new WaitForEndOfFrame());
        }
        Reset();
        AbilityEnded?.Invoke();
    }
    private IEnumerator Attack(AttackState state)
    {
        float time = _usefulTime;

        Instantiate(_shurikenTemplate);
        while (time > 0)
        {
            state.Rigidbody.velocity = Vector3.zero;
            time -= Time.deltaTime;
            yield return(new WaitForEndOfFrame());
        }

        Reset();
        AbilityEnded?.Invoke();
    }
Exemple #8
0
 private void OnAbilityEnded()
 {
     AbilityEnded?.Invoke();
 }