예제 #1
0
    public IEnumerator AbilityCoroutine(float abilityDuration)
    {
        playerController.stateMachine.currentPlayerState = PlayerState.ability;
        if (currentAbility.name == "PlaceBomb")
        {
            currentAbility.Ability(playerController.PlayerRigidbody.position);
        }
        else
        {
            currentAbility.Ability();
        }

        yield return(new WaitForSeconds(abilityDuration));

        playerController.stateMachine.currentPlayerState = PlayerState.idle;
    }
예제 #2
0
  public IEnumerator AbilityCo(float abilityDuration)
  {
      currentState = PlayerState.ability;
      currentAbility.Ability(transform.position, facingDirection, animator, myRigidbody);
      yield return(new WaitForSeconds(abilityDuration));

      currentState = PlayerState.idle;
  }
예제 #3
0
    public IEnumerator PhaseCo(float abilityDuration)
    {
        //TODO **NEEDS ANIMATIONS, NEEDS SCREEN EFFECTS, NEEDS BALANCING** RECALL EFFECT?
        hasPhased       = true;
        hurtBox.enabled = false;
        mySprite.color  = Color.black;
        currentPhase.Ability(transform.position, facingDirection, anim.anim, myRigidbody);
        yield return(new WaitForSeconds(abilityDuration));

        mySprite.color  = Color.white;
        hurtBox.enabled = true;
        StartCoroutine(HasPhasedCo());
    }
예제 #4
0
    //
    public IEnumerator DashCo(float abilityDuration)
    {
        //TODO **NEEDS ANIMATIONS** checks Dash cooldown, if not on CD, changes color, disables player Hurtbox,
        //changes state, Dashes, waits for Duration, resets state, enables Hurtbox, returns color, begins hasDashCo.
        hasDashed       = true;
        hurtBox.enabled = false;
        mySprite.color  = Color.black;
        myState.ChangeState(GenericState.ability);
        currentAbility.Ability(transform.position, facingDirection, anim.anim, myRigidbody);
        yield return(new WaitForSeconds(abilityDuration));

        myState.ChangeState(GenericState.idle);
        mySprite.color  = Color.white;
        hurtBox.enabled = true;
        StartCoroutine(HasDashedCo());
    }
예제 #5
0
    private IEnumerator AttackCo(float abilityDuration)
    {
        anim.SetBool("IsAttacking", true);
        currentState = PlayerState.attack;
        yield return(null);

        currentAbility.Ability(transform.position, facingDirection, anim, myRigidbody2D);


        anim.SetBool("IsAttacking", false);
        yield return(new WaitForSeconds(abilityDuration));

        if (currentState != PlayerState.interact)
        {
            currentState = PlayerState.walk;
        }
    }