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); }
private SkinnedMeshRenderer GetClipBoundSkinnedMeshRenderer() { PlayableDirector selectedDirector = TimelineEditor.inspectedDirector; SkinnedMeshBlendshapeTrack track = base.target as SkinnedMeshBlendshapeTrack; if (selectedDirector != null && track != null) { ParentBindingTrack parentTrack = track.parent as ParentBindingTrack; if (parentTrack != null) { Object binding = parentTrack.GetEditorBinding(selectedDirector); if (binding is GameObject) { return(SkinnedMeshBlendshapeTrack.GetSkinnedMeshFromGameObject((GameObject)binding)); } else if (binding is Transform) { return(SkinnedMeshBlendshapeTrack.GetSkinnedMeshFromGameObject(((Transform)binding).gameObject)); } } else { return(selectedDirector.GetGenericBinding(track) as SkinnedMeshRenderer); } } return(null); }
private Material GetClipBoundMaterial() { PlayableDirector selectedDirector = TimelineEditor.inspectedDirector; MaterialParamTrack track = base.target as MaterialParamTrack; if (selectedDirector != null && track != null) { ParentBindingTrack parentTrack = track.parent as ParentBindingTrack; if (parentTrack != null) { Object binding = parentTrack.GetEditorBinding(selectedDirector); if (binding is Material material) { return(material); } } else { return(selectedDirector.GetGenericBinding(track) as Material); } } return(null); }
protected void ClearChildTrackBindings() { ParentBindingTrack track = (ParentBindingTrack)_trackAsset; foreach (IParentBindableTrackMixer parentBindable in track.GetBoundTracks()) { parentBindable.ClearParentBinding(); } }
protected void SetChildTrackBindings(object playerData) { ParentBindingTrack track = (ParentBindingTrack)_trackAsset; foreach (IParentBindableTrackMixer parentBindable in track.GetBoundTracks()) { parentBindable.SetParentBinding(playerData); } }
public static void OnCreateTrackMixer <TTrack, TMixer>(TTrack track, TMixer mixer, PlayableGraph graph) where TTrack : TrackAsset, IParentBindableTrack where TMixer : PlayableBehaviour, IParentBindableTrackMixer { if (track != null && mixer != null) { ParentBindingTrack parentTrack = track.parent as ParentBindingTrack; if (parentTrack != null) { parentTrack.AddChildTrack(mixer); } } }
public override void OnInspectorGUI() { ParentBindingTrack track = target as ParentBindingTrack; if (track == null) { return; } GUILayout.Label(track.name, EditorStyles.boldLabel); DrawDefaultInspector(); IEnumerable <TrackAsset> childTracks = track.GetChildTracks(); GUILayout.Label("Child Tracks", EditorStyles.boldLabel); GUILayout.Space(3f); _channelTracks.list = new List <TrackAsset>(childTracks); _channelTracks.DoLayoutList(); _channelTracks.index = -1; }