Beispiel #1
0
                private Animator GetClipBoundAnimator()
                {
                    PlayableDirector   selectedDirector = TimelineEditor.inspectedDirector;
                    AnimatorParamTrack track            = base.target as AnimatorParamTrack;

                    if (selectedDirector != null && track != null)
                    {
                        ParentBindingTrack parentTrack = track.parent as ParentBindingTrack;

                        if (parentTrack != null)
                        {
                            Object binding = parentTrack.GetEditorBinding(selectedDirector);

                            if (binding is GameObject)
                            {
                                return(AnimatorParamTrack.GetAnimatorFromGameObject((GameObject)binding));
                            }
                            else if (binding is Transform)
                            {
                                return(AnimatorParamTrack.GetAnimatorFromGameObject(((Transform)binding).gameObject));
                            }
                        }
                        else
                        {
                            return(selectedDirector.GetGenericBinding(track) as Animator);
                        }
                    }

                    return(null);
                }
 public void SetParentBinding(object playerData)
 {
     if (playerData is GameObject)
     {
         _trackBinding  = AnimatorParamTrack.GetAnimatorFromGameObject((GameObject)playerData);
         _parentBinding = true;
     }
     else if (playerData is Transform)
     {
         _trackBinding  = AnimatorParamTrack.GetAnimatorFromGameObject(((Transform)playerData).gameObject);
         _parentBinding = true;
     }
     else
     {
         _parentBinding = false;
     }
 }