Exemplo n.º 1
0
    // OnStateExit is called when a transition ends and the state machine finishes evaluating this state
    override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        if (!Application.isPlaying)
        {
            return;
        }
        Asset_Role role = animator.GetComponent <Asset_Role>();

        if (role && role.Master)
        {
            role.Master.OnAnimStateExit(stateInfo.shortNameHash);
        }
    }
Exemplo n.º 2
0
 // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
 override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     if (Application.isPlaying && !bCanFinish)
     {
         if (stateInfo.normalizedTime >= fNormalizedFinishTime)
         {
             bCanFinish = true;
             Asset_Role role = animator.GetComponent <Asset_Role>();
             if (role && role.Master)
             {
                 role.Master.OnAnimLogicOver(stateInfo.shortNameHash);
             }
         }
     }
 }