예제 #1
0
        private void Start()
        {
            jumpFallState = GetComponent <JumpFall>();

            playerUpgrades = GetComponent <PlayerUpgrades>();
            if (!playerUpgrades)
            {
                Debug.LogError($"{gameObject.name}: {nameof(Crouch)}: Couldn't find {nameof(PlayerUpgrades)}.");
            }
        }
예제 #2
0
        private void FixedUpdate()
        {
            JumpFall jumpInfo = GetComponent <JumpFall>();

            if (jumpCorrection && !jumpInfo.hasDoubleJumped && playerUpgrades.HasDoubleJump)
            {
                jumpCorrection = false;
                animator.SetBool("IsRising", true);
                animator.SetBool("IsFalling", false);
                jumpInfo.hasDoubleJumped = true;
                jumpInfo.hasAttacked     = false;
                jumpInfo.hasFireAttacked = false;
                rBody.velocity           = new Vector2(rBody.velocity.x, 0f);
                fsm.Transition <JumpRise>();
                return;
            }
        }