Example #1
0
        public override void exitState(StateBase stateBase, Animator animator, AnimatorStateInfo stateInfo)
        {
            BoxCollider2D boxCollider2D = stateBase.getController(animator).GetComponent <BoxCollider2D>();

            boxCollider2D.size   = new Vector2(0.16f, 0.41f);
            boxCollider2D.offset = new Vector2(0, 0.21f);
        }
Example #2
0
        public override void enterState(StateBase stateBase, Animator animator, AnimatorStateInfo stateInfo)
        {
            Controller controller = stateBase.getController(animator);

            // reset state parameters
            animator.SetBool(stateBase.getAnimatorHashCodes().collidedUp, false);
        }
Example #3
0
        public override void updateState(StateBase stateBase, Animator animator, AnimatorStateInfo stateInfo)
        {
            Controller controller = stateBase.getController(animator);

            // Can initiate Jump
            checkToJump(animator, controller, stateBase.getAnimatorHashCodes());

            // Check to return to idle
            checkToIdle(animator, controller, stateBase.getAnimatorHashCodes());
        }
Example #4
0
        public override void updateState(StateBase stateBase, Animator animator, AnimatorStateInfo stateInfo)
        {
            Controller    controller    = stateBase.getController(animator);
            BoxCollider2D boxCollider2D = controller.GetComponent <BoxCollider2D>();

            boxCollider2D.offset = new Vector2(0f, 0.08f);
            boxCollider2D.size   = new Vector2(0.16f, 0.16f);

            // Can initiate Jump
            checkToJump(animator, controller, stateBase.getAnimatorHashCodes());

            checkToStand(animator, controller, stateBase.getAnimatorHashCodes());
        }
        public override void updateState(StateBase stateBase, Animator animator, AnimatorStateInfo stateInfo)
        {
            Controller controller = stateBase.getController(animator);

            animator.SetInteger(stateBase.getAnimatorHashCodes().environment, controller.env.GetHashCode());
        }
Example #6
0
        // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
        public override void updateState(StateBase stateBase, Animator animator, AnimatorStateInfo stateInfo)
        {
            Controller controller = stateBase.getController(animator);

            checkToDrop(animator, controller, stateBase.getAnimatorHashCodes());
        }
Example #7
0
 public override void enterState(StateBase stateBase, Animator animator, AnimatorStateInfo stateInfo)
 {
     Controller controller = stateBase.getController(animator);
 }