Пример #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);
            }
        }
Пример #2
0
        public override void FixedUpdate(AriesEntity entity, float dt)
        {
            Rigidbody2D         rigid       = entity.GetAgent().GetComponent <Rigidbody2D>();
            EnvironmentDetector envDetector = entity.GetAgent().GetComponent <EnvironmentDetector>();

            if (envDetector.isOnGround)
            {
                m_bShallChangeToIdle = true;
            }
        }
Пример #3
0
        public override void FixedUpdate(AriesEntity entity, float dt)
        {
            EnvironmentDetector envDetector = entity.GetAgent().GetComponent <EnvironmentDetector>();

            if (!envDetector.isOnGround)
            {
                m_jump.ReduceJumpChance();
                entity.ChangeState(AriesState.Fall);
            }
        }
Пример #4
0
 public AriesStateHurt(AriesEntity entity) : base(entity)
 {
     m_beHit          = entity.GetAgent().GetComponent <AriesBeHit>();
     m_ctrl           = entity.GetAgent().GetComponent <AriesController>();
     m_animBridge     = entity.GetAgent().GetComponent <AriesAnimBridge>();
     m_transform      = entity.GetAgent().GetComponent <Transform>();
     m_spriteRenderer = entity.GetAgent().GetComponent <SpriteRenderer>();
     m_animator       = entity.GetAgent().GetComponent <Animator>();
     m_rigidBody      = entity.GetAgent().GetComponent <Rigidbody2D>();
     m_envDetector    = entity.GetAgent().GetComponent <EnvironmentDetector>();
 }
Пример #5
0
        public override void FixedUpdate(AriesEntity entity, float dt)
        {
            AriesController     ctrl      = entity.GetAgent().GetComponent <AriesController>();
            AriesJump           jumpComp  = entity.GetAgent().GetComponent <AriesJump>();
            Rigidbody2D         rigid     = entity.GetAgent().GetComponent <Rigidbody2D>();
            EnvironmentDetector envDector = entity.GetAgent().GetComponent <EnvironmentDetector>();

            Vector2 curVelocity = rigid.velocity;

            if (curVelocity.y < 0)
            {
                entity.ChangeState(AriesState.Fall);
            }
        }
Пример #6
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);
            }
        }
Пример #7
0
        public override void Update(AriesEntity entity, float dt)
        {
            AriesController     ctrl      = entity.GetAgent().GetComponent <AriesController>();
            AriesJump           jumpComp  = entity.GetAgent().GetComponent <AriesJump>();
            Rigidbody2D         rigid     = entity.GetAgent().GetComponent <Rigidbody2D>();
            EnvironmentDetector envDector = entity.GetAgent().GetComponent <EnvironmentDetector>();

            ctrl.UpdateHorizontalMove();

            if (ctrl.m_jumpButton.IsHold() &&
                jumpComp.GetLeftAvailableHoldDurationForJump2() > 0 &&
                !jumpComp.HasJumpBtnReleased())
            {
                jumpComp.UpdateJump2(dt);
            }
        }
Пример #8
0
 public AriesStateFall(AriesEntity entity) : base(entity)
 {
     m_envDetector = entity.GetAgent().GetComponent <EnvironmentDetector>();
     m_jumpComp    = entity.GetAgent().GetComponent <AriesJump>();
 }
Пример #9
0
 public AriesStateJump1(AriesEntity entity) : base(entity)
 {
     m_jumpComp    = entity.GetAgent().GetComponent <AriesJump>();
     m_rigid       = entity.GetAgent().GetComponent <Rigidbody2D>();
     m_envDetector = entity.GetAgent().GetComponent <EnvironmentDetector>();
 }