Ejemplo n.º 1
0
    // called by update method, when I press attack button
    private void attack(Status s)
    {
        // If I'm already attacking, don't begin again
        if (attacking)
        {
            return;
        }

        SetTrailOnOff(true);

        switch (s)
        {
        // if I'm in idle status, I attack with one hand alternating
        case Status.IDLE:
        {
            attackIndex     = (attackIndex + 1) % (comboAttacks.Length - 1);     // -1 because the last attack is the air attack
            armActualAttack = hands[attackIndex];
            anim.Play(comboAttacks[attackIndex]);
            armActualAttack.EnableTrigger();
            PlayClip(ref missingHitSFX);
            break;
        }

        // if I'm falling, I can start only air attack
        case Status.FALLING:
        {
            if (!airAttackJustDone)
            {
                anim.Play(comboAttacks[attackIndex = comboAttacks.Length - 1]);
                armActualAttack = foots[0];
                armActualAttack.EnableTrigger();
                airAttackJustDone = true;
            }
            break;
        }

        // Start slide attack
        case Status.SLIDE:
        {
            anim.Play("Slide");

            armActualAttack = foots[0];
            armActualAttack.EnableTrigger();
            PlayClip(ref slideSFX);
            break;
        }
        }
        attacking = true;
    }
Ejemplo n.º 2
0
 public void EnableSword()
 {
     Sword.EnableTrigger();
 }