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

            ctrl.UpdateHorizontalMove();

            Vector2 curVelocity = rigid.velocity;

            if (ctrl.m_jumpButton.IsPress() && m_jumpComp.CheckJumpChance())
            {
                entity.ChangeState(AriesState.Jump2);
            }
        }
示例#2
0
        public override void Update(AriesEntity entity, float dt)
        {
            if (m_bShallChangeToIdle)
            {
                entity.ChangeState(AriesState.Idle);
                return;
            }

            AriesController ctrl     = entity.GetAgent().GetComponent <AriesController>();
            AriesJump       jumpComp = entity.GetAgent().GetComponent <AriesJump>();

            ctrl.UpdateHorizontalMove();

            //bool bCtrlJump = ctrl.m_jumpButton.IsPress() || ctrl.m_jumpButton.IsHold();
            bool bCtrlJump = ctrl.m_jumpButton.IsPress();

            if (bCtrlJump && jumpComp.CheckJumpChance())
            {
                m_jumpComp.UpdateJump2(dt);
                entity.ChangeState(AriesState.Jump2);
            }
        }