//================================================================================ // //================================================================================ using UnityEngine; using UnityEditor; using System.Collections; using System.IO; //================================================================================ // //================================================================================ namespace ReaderRabbit { //================================================================================ // //================================================================================ public class RunFromMain : EditorWindow { //================================================================================ // //================================================================================ [MenuItem ("Run/Run from first scene _%#r")] static void Run() { if (!EditorApplication.isPlaying) { EditorApplication.SaveScene(); string currentSceneName = EditorApplication.currentScene; File.WriteAllText(".lastScene", currentSceneName); EditorApplication.OpenScene("Assets/Scenes/_Dummy.unity"); EditorApplication.isPlaying = true; } else { string lastScene = File.ReadAllText(".lastScene"); EditorApplication.isPlaying = false; EditorApplication.OpenScene(lastScene); } } } // public class RunFromMain : EditorWindow } // namespace ReaderRabbit