Esempio n. 1
0
        public sealed override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
        {
            ScriptPlayable <ArgumentPlayableBehaviour> playable = ScriptPlayable <ArgumentPlayableBehaviour> .Null;
            ScriptPlayable <ArgumentPlayableBehaviour> templete = ScriptPlayable <ArgumentPlayableBehaviour> .Null;

            for (int i = 0; i < graph.GetRootPlayableCount(); i++)
            {
                if (graph.GetRootPlayable(i).GetPlayableType().IsTypeOrSubTypeOf(typeof(ArgumentPlayableBehaviour)))
                {
                    templete = (ScriptPlayable <ArgumentPlayableBehaviour>)graph.GetRootPlayable(i);
                }
            }
            OnBeforeCreateArgumentPlayable(graph, owner);
            if (!templete.Equals(playable))
            {
                playable = (ScriptPlayable <ArgumentPlayableBehaviour>)OnCreateArgumentPlayable(graph, owner);
                ArgumentPlayableBehaviour behaviour = playable.GetBehaviour();
                director                = owner.GetComponent <PlayableDirector>();
                timeline                = (TimelineAsset)director.playableAsset;
                trackAsset              = templete.GetBehaviour().trackAsset;
                timelineClip            = trackAsset.FindTimelineClip(this);
                genericBindingObject    = director.GetGenericBinding(trackAsset);
                behaviour.playableAsset = this;
                OnAfterCreateArgumentPlayable(graph, owner, playable);
            }
            return(playable);
        }
Esempio n. 2
0
        public sealed override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
        {
            ScriptPlayable <ArgumentPlayableBehaviour> playable = (ScriptPlayable <ArgumentPlayableBehaviour>)OnCreateArgumentPlayable(graph, go, inputCount);
            ArgumentPlayableBehaviour behaviour = playable.GetBehaviour();

            behaviour.trackAsset = this;
            return(base.CreateTrackMixer(graph, go, inputCount));
        }