/// <summary> /// Performs a single update cycle. /// </summary> public static void Update() { isUpdating = true; Time.FrameTick(false, true); pluginManager.InvokeBeforeUpdate(); UpdateUserInput(); AsyncManager.InvokeBeforeUpdate(); Scene.Current.Update(); AsyncManager.InvokeAfterUpdate(); sound.Update(); pluginManager.InvokeAfterUpdate(); // Perform a cleanup step to catch all DisposeLater calls from this update RunCleanup(); isUpdating = false; if (terminateScheduled) { Terminate(); } }
/// <summary> /// Performs a single update cycle. /// </summary> /// <param name="forceFixedStep">If true use a timestep thats equal to <see cref="Time.MillisecondsPerFrame"/> for the update</param> public static void Update(bool forceFixedStep) { isUpdating = true; Profile.TimeUpdate.BeginMeasure(); Time.FrameTick(forceFixedStep, true); Profile.FrameTick(); VisualLogs.UpdateLogEntries(); pluginManager.InvokeBeforeUpdate(); UpdateUserInput(); Scene.Current.Update(); sound.Update(); pluginManager.InvokeAfterUpdate(); VisualLogs.PrepareRenderLogEntries(); // Perform a cleanup step to catch all DisposeLater calls from this update RunCleanup(); // Perform any previously scheduled Scene switch Scene.PerformScheduledSwitch(); Profile.TimeUpdate.EndMeasure(); isUpdating = false; if (terminateScheduled) { Terminate(); } }
internal static void EditorUpdate(IEnumerable <GameObject> updateObjects, bool freezeScene, bool forceFixedStep) { isUpdating = true; Performance.TimeUpdate.BeginMeasure(); Time.FrameTick(forceFixedStep); Performance.FrameTick(); OnBeforeUpdate(); if (execContext == ExecutionContext.Game) { if (!freezeScene) { UpdateUserInput(); } if (!freezeScene) { Scene.Current.Update(); } else { Scene.Current.EditorUpdate(); } foreach (GameObject obj in updateObjects) { if (!freezeScene && Scene.Current.AllObjects.Contains(obj)) { continue; } obj.Update(); } } else if (execContext == ExecutionContext.Editor) { Scene.Current.EditorUpdate(); foreach (GameObject obj in updateObjects) { obj.Update(); } } sound.Update(); OnAfterUpdate(); CheckOpenALErrors(); //CheckOpenGLErrors(); RunCleanup(); Performance.TimeUpdate.EndMeasure(); isUpdating = false; if (terminateScheduled) { Terminate(); } }
internal static void EditorUpdate(IEnumerable <GameObject> updateObjects, bool simulateGame, bool forceFixedStep) { isUpdating = true; Profile.TimeUpdate.BeginMeasure(); Time.FrameTick(forceFixedStep, simulateGame); Profile.FrameTick(); if (simulateGame) { VisualLog.UpdateLogEntries(); } pluginManager.InvokeBeforeUpdate(); if (simulateGame) { UpdateUserInput(); Scene.Current.Update(); foreach (GameObject obj in updateObjects) { if (obj.ParentScene == Scene.Current) { continue; } obj.IterateComponents <ICmpUpdatable>( l => l.OnUpdate(), l => (l as Component).Active); } } else { Scene.Current.EditorUpdate(); foreach (GameObject obj in updateObjects) { obj.IterateComponents <ICmpUpdatable>( l => l.OnUpdate(), l => (l as Component).Active); } } sound.Update(); pluginManager.InvokeAfterUpdate(); VisualLog.PrepareRenderLogEntries(); RunCleanup(); Profile.TimeUpdate.EndMeasure(); isUpdating = false; if (terminateScheduled) { Terminate(); } }
/// <summary> /// Performs a single update cycle. /// </summary> public static void Update() { isUpdating = true; Performance.TimeUpdate.BeginMeasure(); Time.FrameTick(); Performance.FrameTick(); OnBeforeUpdate(); UpdateUserInput(); Scene.Current.Update(); sound.Update(); OnAfterUpdate(); CheckOpenALErrors(); //CheckOpenGLErrors(); RunCleanup(); Performance.TimeUpdate.EndMeasure(); isUpdating = false; if (terminateScheduled) { Terminate(); } }
/// <summary> /// Performs a single update cycle. /// </summary> public static void Update() { isUpdating = true; Profile.TimeUpdate.BeginMeasure(); Time.FrameTick(); Profile.FrameTick(); VisualLog.UpdateLogEntries(); pluginManager.InvokeBeforeUpdate(); UpdateUserInput(); Scene.Current.Update(); sound.Update(); pluginManager.InvokeAfterUpdate(); VisualLog.PrepareRenderLogEntries(); RunCleanup(); Profile.TimeUpdate.EndMeasure(); isUpdating = false; if (terminateScheduled) { Terminate(); } }
internal static void EditorUpdate(IEnumerable <GameObject> updateObjects, bool simulateGame, bool forceFixedStep) { isUpdating = true; Profile.TimeUpdate.BeginMeasure(); Time.FrameTick(forceFixedStep, simulateGame); Profile.FrameTick(); if (simulateGame) { VisualLogs.UpdateLogEntries(); pluginManager.InvokeBeforeUpdate(); UpdateUserInput(); Scene.Current.Update(); List <ICmpUpdatable> updatables = new List <ICmpUpdatable>(); foreach (GameObject obj in updateObjects) { if (obj.Scene == Scene.Current) { continue; } updatables.Clear(); obj.GetComponents(updatables); for (int i = 0; i < updatables.Count; i++) { if (!(updatables[i] as Component).Active) { continue; } updatables[i].OnUpdate(); } } pluginManager.InvokeAfterUpdate(); } else { Scene.Current.EditorUpdate(); List <ICmpUpdatable> updatables = new List <ICmpUpdatable>(); foreach (GameObject obj in updateObjects) { updatables.Clear(); obj.GetComponents(updatables); for (int i = 0; i < updatables.Count; i++) { if (!(updatables[i] as Component).Active) { continue; } updatables[i].OnUpdate(); } } } sound.Update(); VisualLogs.PrepareRenderLogEntries(); // Perform a cleanup step to catch all DisposeLater calls from this update RunCleanup(); if (simulateGame) { // Perform any previously scheduled Scene switch Scene.PerformScheduledSwitch(); } Profile.TimeUpdate.EndMeasure(); isUpdating = false; if (terminateScheduled) { Terminate(); } }
internal static void EditorUpdate(IEnumerable <GameObject> updateObjects, bool simulateGame, bool forceFixedStep) { isUpdating = true; Time.FrameTick(forceFixedStep, simulateGame); if (simulateGame) { pluginManager.InvokeBeforeUpdate(); UpdateUserInput(); Scene.Current.Update(); List <ICmpUpdatable> updatables = new List <ICmpUpdatable>(); foreach (GameObject obj in updateObjects) { if (obj.Scene == Scene.Current) { continue; } updatables.Clear(); obj.GetComponents(updatables); for (int i = 0; i < updatables.Count; i++) { if (!(updatables[i] as Component).Active) { continue; } updatables[i].OnUpdate(); } } pluginManager.InvokeAfterUpdate(); } else { Scene.Current.EditorUpdate(); List <ICmpUpdatable> updatables = new List <ICmpUpdatable>(); foreach (GameObject obj in updateObjects) { updatables.Clear(); obj.GetComponents(updatables); for (int i = 0; i < updatables.Count; i++) { if (!(updatables[i] as Component).Active) { continue; } updatables[i].OnUpdate(); } } } sound.Update(); RunCleanup(); isUpdating = false; if (terminateScheduled) { Terminate(); } }