Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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>();
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 8
0
 public AriesStateFall(AriesEntity entity) : base(entity)
 {
     m_envDetector = entity.GetAgent().GetComponent <EnvironmentDetector>();
     m_jumpComp    = entity.GetAgent().GetComponent <AriesJump>();
 }
Ejemplo n.º 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>();
 }