/// <summary> /// Get the cached modifications from DB /// </summary> /// <param name="account">Account instance</param> private void GetCachedModificationsForAccount(Account account) { LinkedList <Frame> frames = TimelineManager.GetCachedFramesFromDB(account); foreach (Frame frame in frames) { this.AddFrame(frame); } }
void directorControl_PauseCutscene(object sender, CinemaDirectorArgs e) { TimelineManager c = e.cutscene as TimelineManager; if (c != null) { c.Pause(); } }
void Awake() { if (instance != null) { Debug.LogWarning("More than one of instance of TimelineManager found!"); return; } instance = this; }
/// <summary> /// Spools the events and loads the timeline control /// </summary> protected void OnEnable() { EditorApplication.update = (EditorApplication.CallbackFunction)System.Delegate.Combine(EditorApplication.update, new EditorApplication.CallbackFunction(this.DirectorUpdate)); EditorApplication.playmodeStateChanged = (EditorApplication.CallbackFunction)System.Delegate.Combine(EditorApplication.playmodeStateChanged, new EditorApplication.CallbackFunction(this.PlaymodeStateChanged)); GUISkin skin = ScriptableObject.CreateInstance <GUISkin>(); skin = (EditorGUIUtility.isProSkin) ? EditorGUIUtility.Load("Cinema Suite/Cinema Director/" + PRO_SKIN + ".guiskin") as GUISkin : EditorGUIUtility.Load("Cinema Suite/Cinema Director/" + FREE_SKIN + ".guiskin") as GUISkin; loadTextures(); #if UNITY_5 && !UNITY_5_0 base.titleContent = new GUIContent(TITLE, titleImage); #else base.title = TITLE; #endif SceneView.onSceneGUIDelegate -= OnScene; SceneView.onSceneGUIDelegate += OnScene; directorControl = new DirectorControl(); directorControl.OnLoad(skin); directorControl.PlayCutscene += directorControl_PlayCutscene; directorControl.PauseCutscene += directorControl_PauseCutscene; directorControl.StopCutscene += directorControl_StopCutscene; directorControl.ScrubCutscene += directorControl_ScrubCutscene; directorControl.SetCutsceneTime += directorControl_SetCutsceneTime; directorControl.EnterPreviewMode += directorControl_EnterPreviewMode; directorControl.ExitPreviewMode += directorControl_ExitPreviewMode; directorControl.DragPerformed += directorControl_DragPerformed; isSnappingEnabled = directorControl.IsSnappingEnabled; directorControl.RepaintRequest += directorControl_RepaintRequest; previousTime = DateTime.Now; accumulatedTime = 0; int instanceId = -1; if (EditorPrefs.HasKey("DirectorControl.CutsceneID")) { instanceId = EditorPrefs.GetInt("DirectorControl.CutsceneID"); } if (instanceId >= 0) { TimelineManager[] cutscenes = GameObject.FindObjectsOfType <TimelineManager>(); for (int i = 0; i < cutscenes.Length; i++) { if (cutscenes[i].GetInstanceID() == instanceId) { cutscene = cutscenes[i]; } } } LoadSettings(); }
void directorControl_EnterPreviewMode(object sender, CinemaDirectorArgs e) { TimelineManager c = e.cutscene as TimelineManager; if (c != null) { c.EnterPreviewMode(); } }
void Start() { playableDirector = GetComponent <PlayableDirector>(); instance = this; // 播放状态回调 playableDirector.played += OnPlaying; playableDirector.stopped += OnStopping; }
private void Init() { XYDirectory.Init(); XYCoroutineEngine.Load(); XYSingleAssetLoader.Init(); Loader.Init(); TimelineManager.Init(); World.Init(); }
void directorControl_ScrubCutscene(object sender, CinemaDirectorArgs e) { TimelineManager c = e.cutscene as TimelineManager; if (c != null) { c.ScrubToTime(e.timeArg); } }
private void Start() { timelineManager = timelineManager.GetComponent <TimelineManager>(); goalText.text = bottleCount.ToString() + "/" + bottleGoal.ToString() + " Whiskey Bottles"; tipText.text = "Tip: Shoot to the beat wth the Left Mouse Button. Press \"R\" to Reload!"; tutorialPhaseTwoStarted = false; largeBottle.SetActive(false); levelTransition.SetActive(false); bartender.GetComponent <Animator>().SetBool("isRunning", false); }
public static void Init() { if (!Instance) { var go = new GameObject("TimelineManager"); DontDestroyOnLoad(go); Instance = go.AddComponent <TimelineManager>(); Instance.enabled = true; } }
void directorControl_SetCutsceneTime(object sender, CinemaDirectorArgs e) { TimelineManager c = e.cutscene as TimelineManager; if (c != null) { c.SetRunningTime(e.timeArg); cutsceneWrapper.RunningTime = e.timeArg; } }
public override void OnInspectorGUI() { DrawDefaultInspector(); TimelineManager T = (TimelineManager)target; if (GUILayout.Button("Debug show queues")) { T.DebugShowQueues(); } }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
void Awake() { Engine.InputManager = GetComponent <InputManager>(); Engine.CameraManager = GameObject.Find("Camera Rig").GetComponent <CameraManager>(); Engine.MapCursor = GameObject.Find("Map Cursor").GetComponent <MapCursor>(); Engine.PathManager = GameObject.Find("Tiles").GetComponent <PathManager>(); Engine.TileManager = GameObject.Find("Tiles").GetComponent <TileManager>(); Engine.CombatManager = GameObject.Find("Units").GetComponent <CombatManager>(); Engine.SoundManager = GetComponent <SoundManager>(); Engine.TimelineManager = GameObject.Find("Timelines").GetComponent <TimelineManager>(); }
private void Awake() { if (instance != null) { Debug.LogWarning("Create instance!"); } else { instance = this; } }
public static TimelineManager GetOrCreatInstance() { if (mgr == null) { var go = new GameObject("_Timeline Controllers"); GameObject.DontDestroyOnLoad(go); mgr = new TimelineManager(); mgr.gameObject = go; mgr.transform = go.transform; } return(mgr); }
void Awake() { // Initialize singleton instance if (instance != null && instance != this) { Destroy(gameObject); } else { instance = this; } }
/// <summary> /// Create an instance of <see cref="CoubService"/> with access token /// </summary> /// <param name="accessToken">Access Token for <see cref="CoubService"/></param> public CoubService(string accessToken) { _acceessToken = accessToken ?? throw new ArgumentNullException("accessToken", "accessToken can't be null"); httpClient = new HttpClient(); httpClient.BaseAddress = new Uri(ApiUrlBase); Coubs = new CoubManager(accessToken, httpClient); Timelines = new TimelineManager(accessToken, httpClient); Channels = new ChannelManager(accessToken, httpClient); Recoubs = new RecoubManager(accessToken, httpClient); GeneralSearch = new SearchService(httpClient); }
public static CutsceneWrapper CreateWrapper(TimelineManager cutscene) { CutsceneWrapper wrapper = new CutsceneWrapper(cutscene); if (cutscene != null) { wrapper.RunningTime = cutscene.RunningTime; wrapper.Duration = cutscene.Duration; wrapper.IsPlaying = cutscene.State == TimelineManager.TimeLineState.PreviewPlaying || cutscene.State == TimelineManager.TimeLineState.Playing; foreach (TrackGroup tg in cutscene.TrackGroups) { TrackGroupWrapper tgWrapper = new TrackGroupWrapper(tg); tgWrapper.Ordinal = tg.Ordinal; wrapper.AddTrackGroup(tg, tgWrapper); foreach (TimelineTrack track in tg.GetTracks()) { TimelineTrackWrapper trackWrapper = new TimelineTrackWrapper(track); trackWrapper.Ordinal = track.Ordinal; tgWrapper.AddTrack(track, trackWrapper); foreach (TimelineItem item in track.GetTimelineItems()) { if (item.GetType().IsSubclassOf(typeof(ItemClipCurve))) { ItemClipCurve clip = item as ItemClipCurve; CinemaClipCurveWrapper clipWrapper = new CinemaClipCurveWrapper(clip, clip.Firetime, clip.Duration); trackWrapper.AddItem(clip, clipWrapper); } else if (item.GetType().IsSubclassOf(typeof(TimelineActionFixed))) { TimelineActionFixed actionFixed = item as TimelineActionFixed; CinemaActionFixedWrapper actionFixedWrapper = new CinemaActionFixedWrapper(actionFixed, actionFixed.Firetime, actionFixed.Duration, actionFixed.InTime, actionFixed.OutTime, actionFixed.ItemLength); trackWrapper.AddItem(actionFixed, actionFixedWrapper); } else if (item.GetType().IsSubclassOf(typeof(TimelineAction))) { TimelineAction action = item as TimelineAction; CinemaActionWrapper itemWrapper = new CinemaActionWrapper(action, action.Firetime, action.Duration); trackWrapper.AddItem(action, itemWrapper); } else { TimelineItemWrapper itemWrapper = new TimelineItemWrapper(item, item.Firetime); trackWrapper.AddItem(item, itemWrapper); } } } } } return(wrapper); }
public void FocusCutscene(TimelineManager cutscene) { if (this.cutscene != null) { this.cutscene.ExitPreviewMode(); } directorControl.InPreviewMode = false; EditorPrefs.SetInt("DirectorControl.CutsceneID", cutscene.GetInstanceID()); cutsceneInstanceID = cutscene.GetInstanceID(); this.cutscene = cutscene; }
/// <summary> /// Show the "Add Track Group" context menu. /// </summary> /// <param name="cutscene">The current Cutscene that the track group will be added to.</param> public static void ShowAddTrackGroupContextMenu(TimelineManager cutscene) { GenericMenu createMenu = new GenericMenu(); Type[] subTypes = DirectorHelper.GetAllSubTypes(typeof(TrackGroup)); for (int i = 0; i < subTypes.Length; i++) { TrackGroupContextData userData = getContextDataFromType(cutscene, subTypes[i]); string text = string.Format(userData.Label); createMenu.AddItem(new GUIContent(text), false, new GenericMenu.MenuFunction2(AddTrackGroup), userData); } createMenu.ShowAsContext(); }
/// <summary> /// The recent mails /// </summary> /// <param name="account">With the account data to use on the query</param> private void GetRecentEmails(Account account) { TimelineManager.ReportProgress(new Status(account.ID, "Loading account...")); LinkedList <Frame> frames = new LinkedList <Frame>(); BackgroundWorker bgWorker = new BackgroundWorker(); this.workers.AddLast(bgWorker); bgWorker.WorkerReportsProgress = true; bgWorker.WorkerSupportsCancellation = true; bgWorker.DoWork += new DoWorkEventHandler(delegate(object wsender, DoWorkEventArgs args) { // Load the remote data try { pop3 popClient = new pop3(); String popserver = (account.getOption("popserver")); String port = (account.getOption("popport")); String email = (account.getOption("email")); String password = ConfigurationManager.AuthenticatedUser.Decrypt(account.getOption("password")); Boolean ssl = Convert.ToBoolean((account.getOption("ssl"))); popClient.connect(email, password, popserver, port, ssl); if (popClient.isConnected()) { List <pop3.emailInfo> emails = popClient.getEmail(); foreach (pop3.emailInfo item in emails) { frames.AddLast(new Frame(account, "[" + account.Name + "] From: " + item.from + ": " + item.subject, item.text, item.mailDate, null, account.ID)); } } } catch { //MessageBox.Show(ex.Message+ ex.StackTrace); } }); bgWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(delegate(object wsender, RunWorkerCompletedEventArgs args) { foreach (Frame frame in frames) { TimelineManager.AddFrame(frame); } TimelineManager.RegisterEvent(account); ConfigurationManager.UpdateUserAccount(account); TimelineManager.ReportProgress(new Status(account.ID, frames.Count + " mails loaded.")); this.workers.Remove(bgWorker); }); bgWorker.RunWorkerAsync(account); }
public void IntroduceBulletDeflect(TimelineManager timelineManager) { timelineManager_DeflectTutorial = timelineManager; DeflectTutorial_Jack.GetComponentsInChildren <Animator>()[1].runtimeAnimatorController = null; //Change button sprite according to the controller //UI_DashKey.GetComponent<SpriteRenderer>().sprite = ; timelineManager_DeflectTutorial.PlayTimelineInIndex(0); PlayerCharacter.Singleton.GetFSM().CurrentStateName = "InTutorial_Deflect"; StartCoroutine(ShowGameObjectAfterDelay(1.0f, null)); }
/// <summary> /// Init the control /// </summary> private void _init() { StatusManager.AddStatusListenner(this); // Handler for loading complete this.Loaded += (se, args) => { try { this._parentWindow = (MainWindow)Window.GetWindow(this); if (this._parentWindow != null) { this._parentWindow.lblControlLoading.Visibility = System.Windows.Visibility.Hidden; TimelineManager.Update(); } } catch (Exception) { // this shouldn't happen } }; }
private IEnumerator LodConfig() { yield return(null); isInitOk = false; _data = Resources.Load <TimelineData>(dataConfigName); var playableAsset = Resources.Load <PlayableAsset>(TimelineName); if (!gameObject) { gameObject = new GameObject("TimelineController_" + dataConfigName); director = gameObject.AddComponent <PlayableDirector>(); } director.playableAsset = playableAsset; gameObject.transform.parent = TimelineManager.GetOrCreatInstance().gameObject.transform; isInitOk = true; }
void directorControl_PlayCutscene(object sender, CinemaDirectorArgs e) { TimelineManager c = e.cutscene as TimelineManager; if (c != null) { if (Application.isPlaying) { c.Play(); } else { c.PreviewPlay(); previousTime = System.DateTime.Now; } } }
/// <summary> /// Create a track container for an actor in this cutscene. /// </summary> /// <param name="transform">The transform of the game object</param> /// <returns>the newly created container</returns> public static TrackGroup CreateActorTrackGroup(TimelineManager cutscene, Transform transform) { string trackGroupName = ACTOR_GROUP_NAME; if (transform != null) { trackGroupName = string.Format("{0} Group", transform.name); } GameObject actorGroupGO = new GameObject(trackGroupName, typeof(ActorTrackGroup)); actorGroupGO.transform.parent = cutscene.transform; ActorTrackGroup actorTrackGroup = actorGroupGO.GetComponent <ActorTrackGroup>(); actorTrackGroup.Actor = transform; return(actorTrackGroup); }
protected override void OnUpdate() { float dt = Time.deltaTime; var dic = TimelineManager.GetInstance().GetTimelineDic(); foreach (var item in dic) { var itemlineList = item.Value; if (itemlineList.Count > 0) { var timelineInfo = item.Value[0]; var isOk = Process(timelineInfo); if (isOk) { itemlineList.RemoveAt(0); } } } }
/// <summary> /// Init the control /// </summary> private void _init() { ListCollectionView myCollectionView = (ListCollectionView)CollectionViewSource.GetDefaultView(gridBase.DataContext); myCollectionView.Filter = _filterMoodleAccounts; StatusManager.AddStatusListenner(this); // Handler for loading complete this.Loaded += (se, args) => { try { this._parentWindow = (MainWindow)Window.GetWindow(this); if (this._parentWindow != null) { this._parentWindow.lblControlLoading.Visibility = System.Windows.Visibility.Hidden; TimelineManager.Update(); } } catch (Exception) { // this shouldn't happen } }; }
public static void ReflectChanges(TimelineManager cutscene, CutsceneWrapper wrapper) { if (cutscene == null || wrapper == null) { return; } cutscene.Duration = wrapper.Duration; foreach (TrackGroupWrapper tgw in wrapper.TrackGroups) { TrackGroup tg = tgw.Behaviour as TrackGroup; tg.Ordinal = tgw.Ordinal; foreach (TimelineTrackWrapper trackWrapper in tgw.Tracks) { TimelineTrack track = trackWrapper.Behaviour as TimelineTrack; track.Ordinal = trackWrapper.Ordinal; } } }