void OnGUI() { //GUI.matrix = Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.identity, new Vector3(2.5f, 2.5f, 1)); //if (GUILayout.Button("Restart")) //{ // ReplayManager.Stop(); // SceneManager.LoadScene(SceneManager.GetActiveScene().name); //} if (GUILayout.Button("Playback")) { LastSave = ReplayManager.SerializeCurrent(); SceneManager.LoadScene(SceneManager.GetActiveScene().name); ReplayManager.Play(LastSave); } }
void OnGUI() { if (ReplayManager.IsPlayingBack) { if (GUILayout.Button("Play")) { NetworkManager.sendState = SendState.Autosend; ReplayManager.Stop(); Application.LoadLevel("TestScene"); } } else { if (GUILayout.Button("Replay")) { ReplayManager.Save("Test"); ReplayManager.Play("Test"); Application.LoadLevel("TestScene"); } } }
void OnGUI() { GUI.matrix = Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.identity, new Vector3(2.5f, 2.5f, 1)); if (ReplayManager.CurrentReplay != null) { if (GUILayout.Button("Stop")) { ReplayManager.CurrentReplay = null; ReplayManager.Stop(); Application.LoadLevel(Application.loadedLevel); } if (GUILayout.Button("Rewind")) { ReplayManager.Play(LastSave); Application.LoadLevel(Application.loadedLevel); } } if (ReplayManager.IsPlayingBack) { } else { if (GUILayout.Button("Restart")) { Application.LoadLevel(Application.loadedLevel); } if (GUILayout.Button("Save")) { LastSave = ReplayManager.SerializeCurrent(); Application.LoadLevel(Application.loadedLevel); ReplayManager.Play(LastSave); } } }