/// <summary> /// /!\ This method must be called before EVERYTHING else in the LateTick update. /// </summary> protected void BeforeLateTickGameLogic(out float d, out float unscaled) { GameInputManager.Get().LateTick(); TimeManagementManager.Get().LateTick(); d = TimeManagementManager.Get().GetCurrentDeltaTime(); unscaled = TimeManagementManager.Get().GetCurrentDeltaTimeUnscaled(); }
/// <summary> /// /!\ This method must be called before EVERYTHING else in the Tick update. /// </summary> protected void BeforeTickGameLogic(out float d, out float unscaled) { GameInputManager.Get().Tick(); PersistanceManager.Get().Tick(); TimeManagementManager.Get().Tick(); d = TimeManagementManager.Get().GetCurrentDeltaTime(); unscaled = TimeManagementManager.Get().GetCurrentDeltaTimeUnscaled(); if (levelType != LevelType.STARTMENU) { LevelChunkFXTransitionManager.Get().Tick(d); } }
/// <summary> /// /!\ This method must be called before EVERYTHING else in the FixedTick update. /// </summary> protected void BeforeFixedTickGameLogic(out float d, out float unscaled) { GameInputManager.Get().FixedTick(); TimeManagementManager.Get().FixedTick(); /// When the time is frozen, we set the Physics to autosimulation. /// The reason is that even if time is stopped (Time.deltaTime == 0f), some physics object may be created. /// If Physics.autoSimulation is set to false then no Physics occurs when Time.deltaTime == 0f. So we force it to calculate Physics events event if the time is frozen. if (Physics.autoSimulation && TimeManagementManager.Get().IsTimeFrozen()) { this._simulatePhysicsTimeSteps.Reset(); } Physics.autoSimulation = !TimeManagementManager.Get().IsTimeFrozen(); d = TimeManagementManager.Get().GetCurrentFixedDeltaTime(); unscaled = TimeManagementManager.Get().GetCurrentDeltaTimeUnscaled(); }
private void ClearTest() { this.TestControllerConfiguration.TestControllerDefinition.ClearTest = false; this.SequencedActionPlayer.Kill(); var allInteractiveObjects = InteractiveObjectV2Manager.Get().InteractiveObjects; List <RangeObjectV2> ExcludedRangesToDestroy = new List <RangeObjectV2>(); for (var i = allInteractiveObjects.Count - 1; i >= 0; i--) { //We dont remove the level chunk if (allInteractiveObjects[i].GetType() != typeof(LevelChunkInteractiveObject)) { allInteractiveObjects[i].Destroy(); } else { ExcludedRangesToDestroy.Add((allInteractiveObjects[i] as LevelChunkInteractiveObject).GetLevelChunkRangeObject()); } } for (var i = RangeObjectV2Manager.Get().RangeObjects.Count - 1; i >= 0; i--) { if (!ExcludedRangesToDestroy.Contains(RangeObjectV2Manager.Get().RangeObjects[i])) { RangeObjectV2Manager.Get().RangeObjects[i].OnDestroy(); } } MonoBehaviour.Destroy(TestEntitiesPrefabInstance); GameTestMockedInputManager.MockedInstance.GetGameTestMockedXInput().GameTestInputMockedValues.Reset(); ///Reset camera position CameraMovementJobManager.Get().SetTargetPosition(this.InitialCameraPivotPointTransform); CameraMovementJobManager.Get().SetCameraZoon(this.InitialCameraZoom); ///Reset time management TimeManagementManager.Get().Reset(); }
/// <summary> /// /!\ This method is called when the time is frozen <see cref="TimeManagementManager.IsTimeFrozen"/> /// It manually simulate the physics world. /// Returns true is the physics world has been updated. /// </summary> protected bool BeforeFixedTickTimeFrozenLogic(out float d, out float unscaled) { d = 0.0000000000000000001f; unscaled = TimeManagementManager.Get().GetCurrentDeltaTimeUnscaled(); return(this._simulatePhysicsTimeSteps.Tick(d, unscaled)); }