summaryrefslogtreecommitdiff
path: root/VRCSDK3Worlds/Assets/VRCSDK/Dependencies/VRChat/Scripts/SceneSaver.cs
diff options
context:
space:
mode:
authortylermurphy534 <tylermurphy534@gmail.com>2022-11-06 15:12:42 -0500
committertylermurphy534 <tylermurphy534@gmail.com>2022-11-06 15:12:42 -0500
commiteb84bb298d2b95aec7b2ae12cbf25ac64f25379a (patch)
treeefd616a157df06ab661c6d56651853431ac6b08b /VRCSDK3Worlds/Assets/VRCSDK/Dependencies/VRChat/Scripts/SceneSaver.cs
downloadunityprojects-eb84bb298d2b95aec7b2ae12cbf25ac64f25379a.tar.gz
unityprojects-eb84bb298d2b95aec7b2ae12cbf25ac64f25379a.tar.bz2
unityprojects-eb84bb298d2b95aec7b2ae12cbf25ac64f25379a.zip
move to self host
Diffstat (limited to 'VRCSDK3Worlds/Assets/VRCSDK/Dependencies/VRChat/Scripts/SceneSaver.cs')
-rw-r--r--VRCSDK3Worlds/Assets/VRCSDK/Dependencies/VRChat/Scripts/SceneSaver.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/VRCSDK3Worlds/Assets/VRCSDK/Dependencies/VRChat/Scripts/SceneSaver.cs b/VRCSDK3Worlds/Assets/VRCSDK/Dependencies/VRChat/Scripts/SceneSaver.cs
new file mode 100644
index 00000000..86d56a5d
--- /dev/null
+++ b/VRCSDK3Worlds/Assets/VRCSDK/Dependencies/VRChat/Scripts/SceneSaver.cs
@@ -0,0 +1,18 @@
+using System.Collections;
+using UnityEngine;
+
+public class SceneSaver
+{
+ static public void SaveScene()
+ {
+#if UNITY_EDITOR
+ var activeScene = UnityEditor.SceneManagement.EditorSceneManager.GetActiveScene();
+ UnityEditor.SceneManagement.EditorSceneManager.SaveScene(activeScene);
+
+ UnityEditor.EditorApplication.isPaused = false;
+ UnityEditor.EditorApplication.isPlaying = false;
+
+ UnityEditor.SceneManagement.EditorSceneManager.OpenScene(activeScene.name);
+#endif
+ }
+}