EditorApplication.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Runtime.CompilerServices;
  4. using System.IO;
  5. using BansheeEngine;
  6. namespace BansheeEditor
  7. {
  8. /// <summary>
  9. /// Available tools in the scene view.
  10. /// </summary>
  11. public enum SceneViewTool
  12. {
  13. View,
  14. Move,
  15. Rotate,
  16. Scale
  17. }
  18. /// <summary>
  19. /// Pivot mode used by the scene view tools.
  20. /// </summary>
  21. public enum HandlePivotMode
  22. {
  23. Center,
  24. Pivot
  25. }
  26. /// <summary>
  27. /// Coordinate mode used by the scene view tools.
  28. /// </summary>
  29. public enum HandleCoordinateMode
  30. {
  31. Local,
  32. World
  33. }
  34. /// <summary>
  35. /// Manages various generic and global settings relating to the editor.
  36. /// </summary>
  37. public class EditorApplication
  38. {
  39. /// <summary>
  40. /// Determines the active tool shown in the scene view.
  41. /// </summary>
  42. public static SceneViewTool ActiveSceneTool
  43. {
  44. get { return EditorSettings.ActiveSceneTool; }
  45. set { EditorSettings.ActiveSceneTool = value; }
  46. }
  47. /// <summary>
  48. /// Determines the coordinate mode used by the tools in the scene view.
  49. /// </summary>
  50. public static HandleCoordinateMode ActiveCoordinateMode
  51. {
  52. get { return EditorSettings.ActiveCoordinateMode; }
  53. set { EditorSettings.ActiveCoordinateMode = value; }
  54. }
  55. /// <summary>
  56. /// Determines the pivot mode used by the tools in the scene view.
  57. /// </summary>
  58. public static HandlePivotMode ActivePivotMode
  59. {
  60. get { return EditorSettings.ActivePivotMode; }
  61. set { EditorSettings.ActivePivotMode = value; }
  62. }
  63. /// <summary>
  64. /// Camera used for rendering the scene view.
  65. /// </summary>
  66. public static Camera SceneViewCamera
  67. {
  68. get { return EditorWindow.GetWindow<SceneWindow>().Camera; }
  69. }
  70. /// <summary>
  71. /// Absolute path to the folder containing the currently open project.
  72. /// </summary>
  73. public static string ProjectPath { get { return Internal_GetProjectPath(); } }
  74. /// <summary>
  75. /// Name of the currently open project.
  76. /// </summary>
  77. public static string ProjectName { get { return Internal_GetProjectName(); } }
  78. /// <summary>
  79. /// Checks is any project currently loaded.
  80. /// </summary>
  81. public static bool IsProjectLoaded { get { return Internal_GetProjectLoaded(); } }
  82. /// <summary>
  83. /// Returns the path where the script compiler is located at.
  84. /// </summary>
  85. internal static string CompilerPath { get { return Internal_GetCompilerPath(); } }
  86. /// <summary>
  87. /// Returns the path to the folder where the builtin script assemblies are located at.
  88. /// </summary>
  89. internal static string BuiltinAssemblyPath { get { return Internal_GetBuiltinAssemblyPath(); } }
  90. /// <summary>
  91. /// Returns the path to the folder where the custom script assemblies are located at.
  92. /// </summary>
  93. internal static string ScriptAssemblyPath { get { return Internal_GetScriptAssemblyPath(); } }
  94. /// <summary>
  95. /// Returns the path to the folder where the .NET framework assemblies are located at.
  96. /// </summary>
  97. internal static string FrameworkAssemblyPath { get { return Internal_GetFrameworkAssemblyPath(); } }
  98. /// <summary>
  99. /// Name of the builtin assembly containing engine specific types.
  100. /// </summary>
  101. internal static string EngineAssemblyName { get { return Internal_GetEngineAssemblyName(); } }
  102. /// <summary>
  103. /// Name of the builtin assembly containing editor specific types.
  104. /// </summary>
  105. internal static string EditorAssemblyName { get { return Internal_GetEditorAssemblyName(); } }
  106. /// <summary>
  107. /// Name of the custom assembly compiled from non-editor scripts within the project.
  108. /// </summary>
  109. internal static string ScriptGameAssemblyName { get { return Internal_GetScriptGameAssemblyName(); } }
  110. /// <summary>
  111. /// Name of the custom assembly compiled from editor scripts within the project.
  112. /// </summary>
  113. internal static string ScriptEditorAssemblyName { get { return Internal_GetScriptEditorAssemblyName(); } }
  114. private static EditorApplication instance;
  115. private static FolderMonitor monitor;
  116. private static ScriptCodeManager codeManager;
  117. private static HashSet<string> dirtyResources = new HashSet<string>();
  118. private static bool sceneDirty;
  119. private static bool unitTestsExecuted;
  120. /// <summary>
  121. /// Constructs a new editor application. Called at editor start-up by the runtime.
  122. /// </summary>
  123. internal EditorApplication()
  124. {
  125. instance = this;
  126. codeManager = new ScriptCodeManager();
  127. // Register controls
  128. InputConfiguration inputConfig = VirtualInput.KeyConfig;
  129. inputConfig.RegisterButton(SceneCamera.MoveForwardBinding, ButtonCode.W);
  130. inputConfig.RegisterButton(SceneCamera.MoveBackBinding, ButtonCode.S);
  131. inputConfig.RegisterButton(SceneCamera.MoveLeftBinding, ButtonCode.A);
  132. inputConfig.RegisterButton(SceneCamera.MoveRightBinding, ButtonCode.D);
  133. inputConfig.RegisterButton(SceneCamera.MoveForwardBinding, ButtonCode.Up);
  134. inputConfig.RegisterButton(SceneCamera.MoveBackBinding, ButtonCode.Down);
  135. inputConfig.RegisterButton(SceneCamera.MoveLeftBinding, ButtonCode.Left);
  136. inputConfig.RegisterButton(SceneCamera.MoveRightBinding, ButtonCode.Right);
  137. inputConfig.RegisterButton(SceneCamera.FastMoveBinding, ButtonCode.LeftShift);
  138. inputConfig.RegisterButton(SceneCamera.RotateBinding, ButtonCode.MouseRight);
  139. inputConfig.RegisterAxis(SceneCamera.HorizontalAxisBinding, InputAxis.MouseX);
  140. inputConfig.RegisterAxis(SceneCamera.VerticalAxisBinding, InputAxis.MouseY);
  141. inputConfig.RegisterButton(SceneWindow.ToggleProfilerOverlayBinding, ButtonCode.P, ButtonModifier.CtrlAlt);
  142. inputConfig.RegisterButton(SceneWindow.ViewToolBinding, ButtonCode.Q);
  143. inputConfig.RegisterButton(SceneWindow.MoveToolBinding, ButtonCode.W);
  144. inputConfig.RegisterButton(SceneWindow.RotateToolBinding, ButtonCode.E);
  145. inputConfig.RegisterButton(SceneWindow.ScaleToolBinding, ButtonCode.R);
  146. inputConfig.RegisterButton(SceneWindow.DuplicateBinding, ButtonCode.D, ButtonModifier.Ctrl);
  147. }
  148. /// <summary>
  149. /// Triggered when the folder monitor detects an asset in the monitored folder was modified.
  150. /// </summary>
  151. /// <param name="path">Path to the modified file or folder.</param>
  152. private static void OnAssetModified(string path)
  153. {
  154. ProjectLibrary.Refresh(path);
  155. }
  156. /// <summary>
  157. /// Called 60 times per second by the runtime.
  158. /// </summary>
  159. internal void OnEditorUpdate()
  160. {
  161. ProjectLibrary.Update();
  162. codeManager.Update();
  163. }
  164. /// <summary>
  165. /// Opens a dialog that allows the user to select a new prefab to load as the current scene. If current scene
  166. /// is modified the user is offered a chance to save it.
  167. /// </summary>
  168. [MenuItem("File/Open Scene", ButtonModifier.Ctrl, ButtonCode.L, 10050, true)]
  169. private static void LoadScene()
  170. {
  171. string[] scenePaths;
  172. if (BrowseDialog.OpenFile(ProjectLibrary.ResourceFolder, "", false, out scenePaths))
  173. {
  174. if (scenePaths.Length > 0)
  175. LoadScene(scenePaths[0]);
  176. }
  177. }
  178. /// <summary>
  179. /// Opens a dialog to allows the user to select a location where to save the current scene. If scene was previously
  180. /// saved it is instead automatically saved at the last location.
  181. /// </summary>
  182. [MenuItem("File/Save Scene", ButtonModifier.Ctrl, ButtonCode.S, 10049)]
  183. [ToolbarItem("Save Scene", ToolbarIcon.SaveScene, "", 1998)]
  184. private static void SaveScene()
  185. {
  186. if (!string.IsNullOrEmpty(Scene.ActiveSceneUUID))
  187. {
  188. string scenePath = ProjectLibrary.GetPath(Scene.ActiveSceneUUID);
  189. SaveScene(scenePath);
  190. }
  191. else
  192. SaveSceneAs();
  193. }
  194. /// <summary>
  195. /// Opens a dialog to allows the user to select a location where to save the current scene.
  196. /// </summary>
  197. [MenuItem("File/Save Scene As", 10048)]
  198. private static void SaveSceneAs()
  199. {
  200. string scenePath = "";
  201. if (BrowseDialog.SaveFile(ProjectLibrary.ResourceFolder, "*.prefab", out scenePath))
  202. {
  203. if (!PathEx.IsPartOf(scenePath, ProjectLibrary.ResourceFolder))
  204. DialogBox.Open("Error", "The location must be inside the Resources folder of the project.",
  205. DialogBox.Type.OK);
  206. else
  207. {
  208. // TODO - If path points to an existing non-scene asset or folder I should delete it otherwise
  209. // Internal_SaveScene will silently fail.
  210. scenePath += ".prefab";
  211. SaveScene(scenePath);
  212. LoadScene(scenePath);
  213. }
  214. }
  215. }
  216. /// <summary>
  217. /// Loads a prefab as the current scene at the specified path. If current scene is modified the user is offered a
  218. /// chance to save it.
  219. /// </summary>
  220. /// <param name="path">Path to a valid prefab relative to the resource folder.</param>
  221. public static void LoadScene(string path)
  222. {
  223. Action<string> continueLoad =
  224. (scenePath) =>
  225. {
  226. Scene.Load(path);
  227. SetSceneDirty(false);
  228. ProjectSettings.LastOpenScene = scenePath;
  229. ProjectSettings.Save();
  230. };
  231. Action<DialogBox.ResultType> dialogCallback =
  232. (result) =>
  233. {
  234. if (result == DialogBox.ResultType.Yes)
  235. {
  236. SaveScene();
  237. continueLoad(path);
  238. }
  239. else if (result == DialogBox.ResultType.No)
  240. continueLoad(path);
  241. };
  242. if (IsSceneModified())
  243. {
  244. DialogBox.Open("Warning", "You current scene has modifications. Do you wish to save them first?",
  245. DialogBox.Type.YesNoCancel, dialogCallback);
  246. }
  247. else
  248. continueLoad(path);
  249. }
  250. /// <summary>
  251. /// Saves the currently loaded scene to the specified path.
  252. /// </summary>
  253. /// <param name="path">Path relative to the resource folder. This can be the path to the existing scene
  254. /// prefab if it just needs updating. </param>
  255. public static void SaveScene(string path)
  256. {
  257. Internal_SaveScene(path);
  258. ProjectLibrary.Refresh(true);
  259. SetSceneDirty(false);
  260. }
  261. /// <summary>
  262. /// Checks does the folder at the provieded path contain a valid project.
  263. /// </summary>
  264. /// <param name="path">Absolute path to the root project folder.</param>
  265. /// <returns>True if the folder contains a valid project.</returns>
  266. public static bool IsValidProject(string path)
  267. {
  268. return Internal_IsValidProject(path);
  269. }
  270. /// <summary>
  271. /// Contains a new project in the provided folder.
  272. /// </summary>
  273. /// <param name="path">Absolute path to the folder to create the project in. Name of this folder will be used as the
  274. /// project's name.</param>
  275. public static void CreateProject(string path)
  276. {
  277. Internal_CreateProject(path);
  278. }
  279. /// <summary>
  280. /// Opens a Project Window allowing you to browse for or create a project.
  281. /// </summary>
  282. [MenuItem("File/Open Project", 10100)]
  283. [ToolbarItem("Open Project", ToolbarIcon.OpenProject, "", 2000)]
  284. public static void BrowseForProject()
  285. {
  286. ProjectWindow.Open();
  287. }
  288. /// <summary>
  289. /// Saves all data in the currently open project.
  290. /// </summary>
  291. [MenuItem("File/Save Project", 10099)]
  292. [ToolbarItem("Save Project", ToolbarIcon.SaveProject, "", 1999)]
  293. public static void SaveProject()
  294. {
  295. foreach (var resourceUUID in dirtyResources)
  296. {
  297. string path = ProjectLibrary.GetPath(resourceUUID);
  298. Resource resource = ProjectLibrary.Load<Resource>(path);
  299. if(resource != null)
  300. ProjectLibrary.Save(resource);
  301. }
  302. dirtyResources.Clear();
  303. SetStatusProject(false);
  304. Internal_SaveProject();
  305. }
  306. /// <summary>
  307. /// Loads the project at the specified path. This method executes asynchronously and will trigger
  308. /// <see cref="OnProjectLoaded"/> when done.
  309. /// </summary>
  310. /// <param name="path">Absolute path to the project's root folder.</param>
  311. public static void LoadProject(string path)
  312. {
  313. if (IsProjectLoaded && path == ProjectPath)
  314. return;
  315. if (!Internal_IsValidProject(path))
  316. {
  317. Debug.LogWarning("Provided path: \"" + path + "\" is not a valid project.");
  318. return;
  319. }
  320. if (IsProjectLoaded)
  321. UnloadProject();
  322. Internal_LoadProject(path); // Triggers OnProjectLoaded when done
  323. }
  324. /// <summary>
  325. /// Opens a file or a folder in the default external application.
  326. /// </summary>
  327. /// <param name="path">Absolute path to the file or folder to open.</param>
  328. public static void OpenExternally(string path)
  329. {
  330. Internal_OpenExternally(path);
  331. }
  332. /// <summary>
  333. /// Marks a resource as dirty so that it may be saved the next time the project is saved. Optionally you may also
  334. /// call <see cref="ProjectLibrary.Save"/> to save it immediately.
  335. /// </summary>
  336. /// <param name="resource">Resource to mark as dirty</param>
  337. public static void SetDirty(Resource resource)
  338. {
  339. if (resource == null)
  340. return;
  341. SetStatusProject(true);
  342. dirtyResources.Add(resource.UUID);
  343. }
  344. /// <summary>
  345. /// Marks the current scene as dirty.
  346. /// </summary>
  347. public static void SetSceneDirty()
  348. {
  349. SetSceneDirty(true);
  350. }
  351. /// <summary>
  352. /// Marks the current scene as clean or dirty.
  353. /// </summary>
  354. /// <param name="dirty">Should the scene be marked as clean or dirty.</param>
  355. internal static void SetSceneDirty(bool dirty)
  356. {
  357. sceneDirty = dirty;
  358. SetStatusScene(Scene.ActiveSceneName, dirty);
  359. if (!dirty)
  360. dirtyResources.Remove(Scene.ActiveSceneUUID);
  361. }
  362. /// <summary>
  363. /// Checks is the specific resource dirty and needs saving.
  364. /// </summary>
  365. /// <param name="resource">Resource to check.</param>
  366. /// <returns>True if the resource requires saving, false otherwise.</returns>
  367. public static bool IsDirty(Resource resource)
  368. {
  369. return dirtyResources.Contains(resource.UUID);
  370. }
  371. /// <summary>
  372. /// Triggered when <see cref="LoadProject"/> method completes.
  373. /// </summary>
  374. private static void OnProjectLoaded()
  375. {
  376. SetStatusProject(false);
  377. if (!unitTestsExecuted)
  378. {
  379. RunUnitTests();
  380. unitTestsExecuted = true;
  381. }
  382. if (!IsProjectLoaded)
  383. {
  384. ProjectWindow.Open();
  385. return;
  386. }
  387. string projectPath = ProjectPath;
  388. RecentProject[] recentProjects = EditorSettings.RecentProjects;
  389. bool foundPath = false;
  390. for (int i = 0; i < recentProjects.Length; i++)
  391. {
  392. if (PathEx.Compare(recentProjects[i].path, projectPath))
  393. {
  394. recentProjects[i].accessTimestamp = (ulong)DateTime.Now.Ticks;
  395. EditorSettings.RecentProjects = recentProjects;
  396. foundPath = true;
  397. break;
  398. }
  399. }
  400. if (!foundPath)
  401. {
  402. List<RecentProject> extendedRecentProjects = new List<RecentProject>();
  403. extendedRecentProjects.AddRange(recentProjects);
  404. RecentProject newProject = new RecentProject();
  405. newProject.path = projectPath;
  406. newProject.accessTimestamp = (ulong)DateTime.Now.Ticks;
  407. extendedRecentProjects.Add(newProject);
  408. EditorSettings.RecentProjects = extendedRecentProjects.ToArray();
  409. }
  410. EditorSettings.LastOpenProject = projectPath;
  411. EditorSettings.Save();
  412. ProjectLibrary.Refresh();
  413. monitor = new FolderMonitor(ProjectLibrary.ResourceFolder);
  414. monitor.OnAdded += OnAssetModified;
  415. monitor.OnRemoved += OnAssetModified;
  416. monitor.OnModified += OnAssetModified;
  417. if (!string.IsNullOrWhiteSpace(ProjectSettings.LastOpenScene))
  418. {
  419. Scene.Load(ProjectSettings.LastOpenScene);
  420. SetSceneDirty(false);
  421. }
  422. }
  423. /// <summary>
  424. /// Unloads the currently loaded project. Offers the user a chance to save the current scene if it is modified.
  425. /// Automatically saves all project data before unloading.
  426. /// </summary>
  427. private static void UnloadProject()
  428. {
  429. Action continueUnload =
  430. () =>
  431. {
  432. Scene.Clear();
  433. if (monitor != null)
  434. {
  435. monitor.Destroy();
  436. monitor = null;
  437. }
  438. LibraryWindow window = EditorWindow.GetWindow<LibraryWindow>();
  439. if(window != null)
  440. window.Reset();
  441. SetSceneDirty(false);
  442. Internal_UnloadProject();
  443. SetStatusProject(false);
  444. };
  445. Action<DialogBox.ResultType> dialogCallback =
  446. (result) =>
  447. {
  448. if (result == DialogBox.ResultType.Yes)
  449. SaveScene();
  450. continueUnload();
  451. };
  452. if (IsSceneModified())
  453. {
  454. DialogBox.Open("Warning", "You current scene has modifications. Do you wish to save them first?",
  455. DialogBox.Type.YesNoCancel, dialogCallback);
  456. }
  457. else
  458. continueUnload();
  459. }
  460. /// <summary>
  461. /// Reloads all script assemblies in case they were modified. This action is delayed and will be executed
  462. /// at the beginning of the next frame.
  463. /// </summary>
  464. public static void ReloadAssemblies()
  465. {
  466. Internal_ReloadAssemblies();
  467. }
  468. /// <summary>
  469. /// Changes the scene displayed on the status bar.
  470. /// </summary>
  471. /// <param name="name">Name of the scene.</param>
  472. /// <param name="modified">Whether to display the scene as modified or not.</param>
  473. private static void SetStatusScene(string name, bool modified)
  474. {
  475. Internal_SetStatusScene(name, modified);
  476. }
  477. /// <summary>
  478. /// Changes the project state displayed on the status bar.
  479. /// </summary>
  480. /// <param name="modified">Whether to display the project as modified or not.</param>
  481. private static void SetStatusProject(bool modified)
  482. {
  483. Internal_SetStatusProject(modified);
  484. }
  485. /// <summary>
  486. /// Displays or hides the "compilation in progress" visual on the status bar.
  487. /// </summary>
  488. /// <param name="compiling">True to display the visual, false otherwise.</param>
  489. internal static void SetStatusCompiling(bool compiling)
  490. {
  491. Internal_SetStatusCompiling(compiling);
  492. }
  493. /// <summary>
  494. /// Checks did we make any modifications to the scene since it was last saved.
  495. /// </summary>
  496. /// <returns>True if the scene was never saved, or was modified after last save.</returns>
  497. public static bool IsSceneModified()
  498. {
  499. return sceneDirty;
  500. }
  501. /// <summary>
  502. /// Executes any editor-specific unit tests. This should be called after a project is loaded if possible.
  503. /// </summary>
  504. private static void RunUnitTests()
  505. {
  506. #if DEBUG
  507. Internal_RunUnitTests();
  508. #endif
  509. }
  510. [MethodImpl(MethodImplOptions.InternalCall)]
  511. private static extern void Internal_SetStatusScene(string name, bool modified);
  512. [MethodImpl(MethodImplOptions.InternalCall)]
  513. private static extern void Internal_SetStatusProject(bool modified);
  514. [MethodImpl(MethodImplOptions.InternalCall)]
  515. private static extern void Internal_SetStatusCompiling(bool compiling);
  516. [MethodImpl(MethodImplOptions.InternalCall)]
  517. private static extern string Internal_GetProjectPath();
  518. [MethodImpl(MethodImplOptions.InternalCall)]
  519. private static extern string Internal_GetProjectName();
  520. [MethodImpl(MethodImplOptions.InternalCall)]
  521. private static extern bool Internal_GetProjectLoaded();
  522. [MethodImpl(MethodImplOptions.InternalCall)]
  523. private static extern string Internal_GetCompilerPath();
  524. [MethodImpl(MethodImplOptions.InternalCall)]
  525. private static extern string Internal_GetBuiltinAssemblyPath();
  526. [MethodImpl(MethodImplOptions.InternalCall)]
  527. private static extern string Internal_GetScriptAssemblyPath();
  528. [MethodImpl(MethodImplOptions.InternalCall)]
  529. private static extern string Internal_GetFrameworkAssemblyPath();
  530. [MethodImpl(MethodImplOptions.InternalCall)]
  531. private static extern string Internal_GetEngineAssemblyName();
  532. [MethodImpl(MethodImplOptions.InternalCall)]
  533. private static extern string Internal_GetEditorAssemblyName();
  534. [MethodImpl(MethodImplOptions.InternalCall)]
  535. private static extern string Internal_GetScriptGameAssemblyName();
  536. [MethodImpl(MethodImplOptions.InternalCall)]
  537. private static extern string Internal_GetScriptEditorAssemblyName();
  538. [MethodImpl(MethodImplOptions.InternalCall)]
  539. private static extern string Internal_SaveScene(string path);
  540. [MethodImpl(MethodImplOptions.InternalCall)]
  541. private static extern bool Internal_IsValidProject(string path);
  542. [MethodImpl(MethodImplOptions.InternalCall)]
  543. private static extern void Internal_SaveProject();
  544. [MethodImpl(MethodImplOptions.InternalCall)]
  545. private static extern void Internal_LoadProject(string path);
  546. [MethodImpl(MethodImplOptions.InternalCall)]
  547. private static extern void Internal_UnloadProject();
  548. [MethodImpl(MethodImplOptions.InternalCall)]
  549. private static extern void Internal_CreateProject(string path);
  550. [MethodImpl(MethodImplOptions.InternalCall)]
  551. private static extern void Internal_ReloadAssemblies();
  552. [MethodImpl(MethodImplOptions.InternalCall)]
  553. private static extern void Internal_OpenExternally(string path);
  554. [MethodImpl(MethodImplOptions.InternalCall)]
  555. private static extern void Internal_RunUnitTests();
  556. }
  557. }