Exemple #1
0
    public void CreatePuppet(Character forWhom)
    {
        CharacterPuppet newPuppet = Instantiate(emptyPuppet).GetComponent <CharacterPuppet>();

        newPuppet.character = forWhom;
        forWhom.puppet      = newPuppet;
    }
 // 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)
 {
     character = animator.gameObject.GetComponentInParent <CharacterPuppet> ();
     if (character == null && !complainedOnce)
     {
         Debug.Log("no character set for animation restriction");
         complainedOnce = true;
         return;
     }
     if (useRootMotion)
     {
         character.takingRootMotion = true;
     }
 }