Ejemplo n.º 1
0
    private IEnumerator IE_Punch()
    {
        myIsPunching = true;
        myPlayer.GetPlayerMovement().Block(true);
        myAnimator.SetTrigger("Punch");

        List <Enemy> enemies = myHitBox.GetCollidingObjects();

        yield return(new WaitForSeconds(myPunchAnimation.length / 2.0f));

        for (int i = 0; i < enemies.Count; i++)
        {
            enemies[i].GetEnemyLife().RemoveLife(myPunchDamage);
        }

        yield return(new WaitForSeconds(myPunchAnimation.length / 2.0f));
    }