private void OnSimulationConcluded() { Physics.autoSimulation = true; _currentSpace = Timespace.FUTURE; SetFutureInteractions(); ToggleCulling(); }
private void OnGoBackConcluded() { if (_futureContainer != null) { Destroy(_futureContainer); } SetPastInteractions(); _currentSpace = Timespace.PAST; ToggleCulling(); }
public void ChangeState(Timespace state, bool playTransition = true) { if (playTransition) { TransitionController.Instance.StartTimeTransition(); } switch (state) { case Timespace.FUTURE: Simulate(); break; case Timespace.PAST: _currentSpace = Timespace.GOBACK; break; } _stateChangeTime = Time.realtimeSinceStartup; }
private void Simulate() { PastRigidbodies = PastContainer.GetComponentsInChildren <Rigidbody>(); foreach (var pastRigidbody in PastRigidbodies) { pastRigidbody.velocity = Vector3.zero; pastRigidbody.angularVelocity = Vector3.zero; } _futureContainer = Instantiate(PastContainer); _futureActionCommands = _futureContainer.GetComponentsInChildren <ActionCommand>(); _futureContainer.name = "FutureContainer"; Utils.SetLayerRecursively(_futureContainer, _futureLayer); _currentSpace = Timespace.SIMULATION; foreach (var futureActionCommand in _futureActionCommands) { futureActionCommand.OnCommand(); } Physics.autoSimulation = false; SetSimulationInteractions(); }