/// <summary> /// 快捷键F5运行unity /// </summary> [MenuItem ("CTool/Run Or Stop _F5", false, 1)] static void RunApp () { if (!EditorApplication.isPlaying) { //打开对应的场景(场景路径) EditorApplication.OpenScene(Application.dataPath+"/Scene/Main.unity"); EditorApplication.isPlaying = true; } else { EditorApplication.isPlaying = false; } }
/// <summary> /// 快捷键F2打开对应的场景 /// </summary> [MenuItem ("CTool/Clear And Run _F2", false, 30)] static void OpenUiScene() { EditorApplication.OpenScene(Application.dataPath+"/Scene/UI.unity"); }
/// <summary> /// 快捷键F1打开OpenPersitent目录 /// </summary> [MenuItem ("CTool/OpenPersitentPath _F1", false, 30)] static void OpenPersitentPath () { if (Application.platform == RuntimePlatform.OSXEditor) { System.Diagnostics.Process.Start (Application.persistentDataPath); } else if (Application.platform == RuntimePlatform.WindowsEditor) { EditorUtility.RevealInFinder (Application.persistentDataPath); } }