示例#1
0
文件: Fighter.cs 项目: nasa03/ness
    /*
     * Set the fighter in Blocking state. Play animations and sounds.
     */
    public void Block()
    {
        // Do not let them block if they don't have any durability left.
        if (IsShieldBroken())
        {
            // Could play an error sound here.
            return;
        }

        if (isBlocking || isAttacking || chargeUpTimer.IsRunning())
        {
            return;
        }

        if (IsIdle() || IsMoving())
        {
            PlaySound(shieldUpSound);
            shieldTime.StartTimer();
            isBlocking = true;
        }
    }
示例#2
0
文件: Fighter.cs 项目: nasa03/ness
 /*
  * Begins the fighter charging up an attack. Performs logic around charging,
  * sets fighter state, and kicks off the charge animation.
  */
 void StartChargingWeapon()
 {
     chargeUpTimer.StartTimer();
     currentChargeUpTime = 0;
     animation.CrossFade(currentAttack.chargeAnimation.name, 0.1f);
 }