예제 #1
0
 private void CheckAttackEnding()
 {
     if (currentAttack != null && !currentAttack.Ongoing)
     {
         currentAttack = null;
         canAttack     = true;
     }
 }
예제 #2
0
        // Start is called before the first frame update
        void Start()
        {
            foreach (GameObject attackPart in attackParts)
            {
                attackPart.SetActive(false);
            }

            extraJumpsReserve = extraJumps;
            currentAttack     = null;
        }
예제 #3
0
        void AttackCommand()
        {
            if (currentAttack != null)
            {
                return;
            }

            if (attackInput)
            {
                canAttack = false;

                if (!inAir)
                {
                    if (stickDirection == StickDirection.Up)
                    {
                        currentAttack = upAttack.StartAttack(facingRight);
                    }
                    else
                    {
                        currentAttack = neutralAttack.StartAttack(facingRight);
                    }
                }
                else
                {
                    switch (stickDirection)
                    {
                    case StickDirection.Neutral:
                        currentAttack = neutralAir.StartAttack(facingRight);
                        break;

                    case StickDirection.Right:
                        if (facingRight)
                        {
                            currentAttack = forwardAir.StartAttack(facingRight);
                        }
                        else
                        {
                            currentAttack = backAir.StartAttack(facingRight);
                        }
                        break;

                    case StickDirection.Left:
                        if (!facingRight)
                        {
                            currentAttack = forwardAir.StartAttack(facingRight);
                        }
                        else
                        {
                            currentAttack = backAir.StartAttack(facingRight);
                        }
                        break;

                    case StickDirection.Up:
                        currentAttack = upAir.StartAttack(facingRight);
                        break;

                    case StickDirection.Down:
                        currentAttack = downAir.StartAttack(facingRight);
                        break;
                    }
                }
            }
            else if (chargedInput && !inAir)
            {
                canAttack  = false;
                IsCharging = true;
                if (stickDirection == StickDirection.Up)
                {
                    currentAttack = upCharged.StartAttack(facingRight);
                }
                else
                {
                    currentAttack = forwardCharged.StartAttack(facingRight);
                }

                //canAttack = false;
                StartCoroutine(ChargingAttack());
            }
        }