示例#1
0
        public override void FixedUpdate(AriesEntity entity, float dt)
        {
            AriesController     ctrl      = entity.GetAgent().GetComponent <AriesController>();
            Rigidbody2D         rigid     = entity.GetAgent().GetComponent <Rigidbody2D>();
            EnvironmentDetector envDector = entity.GetAgent().GetComponent <EnvironmentDetector>();

            Vector2 curVelocity = rigid.velocity;

            if (ctrl.m_jumpButton.IsRelease())
            {
                m_jumpComp.JumpBtnReleased();
            }
            else
            {
                if (
                    (ctrl.m_jumpButton.IsPress() || ctrl.m_jumpButton.IsHold()) &&
                    m_jumpComp.GetLeftAvailableHoldDurationForJump1() > 0
                    )
                {
                    m_jumpComp.UpdateJump(dt);
                }
            }

            if (curVelocity.y < 0)
            {
                entity.ChangeState(AriesState.Fall);
            }
        }