public static void OpenLastScene() { var lastScene = EditorPrefs.GetString(LastScenePrefKey); if (!string.IsNullOrEmpty(lastScene)) { ToolsHelper.OpenScene(lastScene); } else { ToolsHelper.Error("Not found last scene!"); } }
public static void OpenMainScene() { #if UNITY_5 || UNITY_2017_1_OR_NEWER var currentScene = EditorSceneManager.GetActiveScene().path; #else var currentScene = EditorApplication.currentScene; #endif var mainScene = "Assets/GameRes/BundleRes/Scene/MineGameMain.unity"; if (mainScene != currentScene) { EditorPrefs.SetString(LastScenePrefKey, currentScene); } ToolsHelper.OpenScene(mainScene); if (!EditorApplication.isPlaying) { EditorApplication.isPlaying = true; } }