/** * <summary>Creates a new instance of the 'Engine: Control Timeline' Action, set to stop a currently-playing Timeline</summary> * <param name = "director">The PlayableDirector to stop</param> * <param name = "pauseTimeline">If True, the Timeline will be paused as opposed to stopped and reset</param> * <param name = "disableACCamera">If True, the AC MainCamera will be enabled</param> * <returns>The generated Action</returns> */ public static ActionTimeline CreateNew_Stop(PlayableDirector director, bool pauseTimeline = true, bool enableACCamera = true) { ActionTimeline newAction = (ActionTimeline)CreateInstance <ActionTimeline>(); newAction.method = ActionDirectorMethod.Stop; newAction.director = director; newAction.pause = pauseTimeline; newAction.disableCamera = enableACCamera; return(newAction); }
/** * <summary>Creates a new instance of the 'Engine: Control Timeline' Action, set to play a new Timeline</summary> * <param name = "director">The PlayableDirector to play from</param> * <param name = "timelineAsset">If set, the TimelineAsset to assign to the PlayableDirector</param> * <param name = "playFromBeginning">If True, the Timeline will be played from the start</param> * <param name = "disableACCamera">If True, the AC MainCamera will be disabled</param> * <param name = "waitUntilFinish">If True, then the Action will wait until the Timeline has finished playing</param> * <returns>The generated Action</returns> */ public static ActionTimeline CreateNew_Play(PlayableDirector director, TimelineAsset timelineAsset = null, bool playFromBeginning = true, bool disableACCamera = false, bool waitUntilFinish = false) { ActionTimeline newAction = (ActionTimeline)CreateInstance <ActionTimeline>(); newAction.method = ActionDirectorMethod.Play; newAction.director = director; newAction.newTimeline = timelineAsset; newAction.restart = (timelineAsset != null) ? playFromBeginning : false; newAction.disableCamera = disableACCamera; newAction.willWait = waitUntilFinish; return(newAction); }