Beispiel #1
0
 protected void lazyInit(Animator animator)
 {
     if (roleController == null)
     {
         roleController = animator.GetComponentInParent <Tang.RoleController>();
     }
 }
Beispiel #2
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);
            }
        }
    }
Beispiel #3
0
 private void lazyInit(Animator animator)
 {
     roleController = animator.GetComponentInParent <Tang.RoleController>();
 }