Пример #1
0
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        base.OnStateEnter(animator, stateInfo, layerIndex);

        if (roleController == null)
        {
            roleController = animator.GetComponentInParent <Tang.RoleController>();
        }

        if (roleController != null)
        {
            if (roleController.GetDirectionInt() > 0)
            {
                roleController.SetDirection(Tang.Direction.Left);
            }
            else
            {
                roleController.SetDirection(Tang.Direction.Right);
            }
        }
    }