private IEnumerator Attack(AttackState state)
    {
        var spawned = Instantiate(_shuriken);

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

        Reset();
        AbilityEnded?.Invoke();
    }
    IEnumerator Attack(AttackState state)
    {
        state.Rigidbody.velocity = Vector3.zero;

        yield return(new WaitForSeconds(_attackDelay));

        SpawnShuriken(state);

        _coroutine = null;
        AbilityEnded?.Invoke();
    }
Exemple #3
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 #5
0
 private void OnAbilityEnded()
 {
     AbilityEnded?.Invoke();
 }