EditorApplication.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  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. /// Creates a new empty scene.
  166. /// </summary>
  167. [MenuItem("File/New Scene", 10051, true)]
  168. private static void NewScene()
  169. {
  170. LoadScene(null);
  171. }
  172. /// <summary>
  173. /// Opens a dialog that allows the user to select a new prefab to load as the current scene. If current scene
  174. /// is modified the user is offered a chance to save it.
  175. /// </summary>
  176. [MenuItem("File/Open Scene", ButtonModifier.Ctrl, ButtonCode.L, 10050)]
  177. private static void LoadScene()
  178. {
  179. string[] scenePaths;
  180. if (BrowseDialog.OpenFile(ProjectLibrary.ResourceFolder, "", false, out scenePaths))
  181. {
  182. if (scenePaths.Length > 0)
  183. LoadScene(scenePaths[0]);
  184. }
  185. }
  186. /// <summary>
  187. /// Opens a dialog to allows the user to select a location where to save the current scene. If scene was previously
  188. /// saved it is instead automatically saved at the last location.
  189. /// </summary>
  190. [MenuItem("File/Save Scene", ButtonModifier.Ctrl, ButtonCode.S, 10049)]
  191. [ToolbarItem("Save Scene", ToolbarIcon.SaveScene, "", 1998)]
  192. private static void SaveScene()
  193. {
  194. if (!string.IsNullOrEmpty(Scene.ActiveSceneUUID))
  195. {
  196. string scenePath = ProjectLibrary.GetPath(Scene.ActiveSceneUUID);
  197. SaveScene(scenePath);
  198. }
  199. else
  200. SaveSceneAs();
  201. }
  202. /// <summary>
  203. /// Opens a dialog to allows the user to select a location where to save the current scene.
  204. /// </summary>
  205. [MenuItem("File/Save Scene As", 10048)]
  206. private static void SaveSceneAs()
  207. {
  208. string scenePath = "";
  209. if (BrowseDialog.SaveFile(ProjectLibrary.ResourceFolder, "*.prefab", out scenePath))
  210. {
  211. if (!PathEx.IsPartOf(scenePath, ProjectLibrary.ResourceFolder))
  212. DialogBox.Open("Error", "The location must be inside the Resources folder of the project.",
  213. DialogBox.Type.OK);
  214. else
  215. {
  216. // TODO - If path points to an existing non-scene asset or folder I should delete it otherwise
  217. // Internal_SaveScene will silently fail.
  218. scenePath += ".prefab";
  219. SaveScene(scenePath);
  220. }
  221. }
  222. }
  223. /// <summary>
  224. /// Loads a prefab as the current scene at the specified path. If current scene is modified the user is offered a
  225. /// chance to save it.
  226. /// </summary>
  227. /// <param name="path">Path to a valid prefab relative to the resource folder. If path is empty a brand new
  228. /// scene will be loaded.</param>
  229. public static void LoadScene(string path)
  230. {
  231. Action<string> continueLoad =
  232. (scenePath) =>
  233. {
  234. if (string.IsNullOrEmpty(path))
  235. Scene.Clear();
  236. else
  237. Scene.Load(path);
  238. SetSceneDirty(false);
  239. ProjectSettings.LastOpenScene = scenePath;
  240. ProjectSettings.Save();
  241. };
  242. Action<DialogBox.ResultType> dialogCallback =
  243. (result) =>
  244. {
  245. if (result == DialogBox.ResultType.Yes)
  246. {
  247. SaveScene();
  248. continueLoad(path);
  249. }
  250. else if (result == DialogBox.ResultType.No)
  251. continueLoad(path);
  252. };
  253. if (IsSceneModified())
  254. {
  255. DialogBox.Open("Warning", "You current scene has modifications. Do you wish to save them first?",
  256. DialogBox.Type.YesNoCancel, dialogCallback);
  257. }
  258. else
  259. continueLoad(path);
  260. }
  261. /// <summary>
  262. /// Saves the currently loaded scene to the specified path.
  263. /// </summary>
  264. /// <param name="path">Path relative to the resource folder. This can be the path to the existing scene
  265. /// prefab if it just needs updating. </param>
  266. public static void SaveScene(string path)
  267. {
  268. Internal_SaveScene(path);
  269. ProjectLibrary.Refresh(true);
  270. SetSceneDirty(false);
  271. }
  272. /// <summary>
  273. /// Checks does the folder at the provieded path contain a valid project.
  274. /// </summary>
  275. /// <param name="path">Absolute path to the root project folder.</param>
  276. /// <returns>True if the folder contains a valid project.</returns>
  277. public static bool IsValidProject(string path)
  278. {
  279. return Internal_IsValidProject(path);
  280. }
  281. /// <summary>
  282. /// Contains a new project in the provided folder.
  283. /// </summary>
  284. /// <param name="path">Absolute path to the folder to create the project in. Name of this folder will be used as the
  285. /// project's name.</param>
  286. public static void CreateProject(string path)
  287. {
  288. Internal_CreateProject(path);
  289. }
  290. /// <summary>
  291. /// Opens a Project Window allowing you to browse for or create a project.
  292. /// </summary>
  293. [MenuItem("File/Open Project", 10100)]
  294. [ToolbarItem("Open Project", ToolbarIcon.OpenProject, "", 2000)]
  295. public static void BrowseForProject()
  296. {
  297. ProjectWindow.Open();
  298. }
  299. /// <summary>
  300. /// Saves all data in the currently open project.
  301. /// </summary>
  302. [MenuItem("File/Save Project", 10099)]
  303. [ToolbarItem("Save Project", ToolbarIcon.SaveProject, "", 1999)]
  304. public static void SaveProject()
  305. {
  306. foreach (var resourceUUID in dirtyResources)
  307. {
  308. string path = ProjectLibrary.GetPath(resourceUUID);
  309. Resource resource = ProjectLibrary.Load<Resource>(path);
  310. if(resource != null)
  311. ProjectLibrary.Save(resource);
  312. }
  313. dirtyResources.Clear();
  314. SetStatusProject(false);
  315. Internal_SaveProject();
  316. }
  317. /// <summary>
  318. /// Loads the project at the specified path. This method executes asynchronously and will trigger
  319. /// <see cref="OnProjectLoaded"/> when done.
  320. /// </summary>
  321. /// <param name="path">Absolute path to the project's root folder.</param>
  322. public static void LoadProject(string path)
  323. {
  324. if (IsProjectLoaded && path == ProjectPath)
  325. return;
  326. if (!Internal_IsValidProject(path))
  327. {
  328. Debug.LogWarning("Provided path: \"" + path + "\" is not a valid project.");
  329. return;
  330. }
  331. if (IsProjectLoaded)
  332. UnloadProject();
  333. Internal_LoadProject(path); // Triggers OnProjectLoaded when done
  334. }
  335. /// <summary>
  336. /// Opens a file or a folder in the default external application.
  337. /// </summary>
  338. /// <param name="path">Absolute path to the file or folder to open.</param>
  339. public static void OpenExternally(string path)
  340. {
  341. Internal_OpenExternally(path);
  342. }
  343. /// <summary>
  344. /// Marks a resource as dirty so that it may be saved the next time the project is saved. Optionally you may also
  345. /// call <see cref="ProjectLibrary.Save"/> to save it immediately.
  346. /// </summary>
  347. /// <param name="resource">Resource to mark as dirty</param>
  348. public static void SetDirty(Resource resource)
  349. {
  350. if (resource == null)
  351. return;
  352. SetStatusProject(true);
  353. dirtyResources.Add(resource.UUID);
  354. }
  355. /// <summary>
  356. /// Marks the current scene as dirty.
  357. /// </summary>
  358. public static void SetSceneDirty()
  359. {
  360. SetSceneDirty(true);
  361. }
  362. /// <summary>
  363. /// Marks the current scene as clean or dirty.
  364. /// </summary>
  365. /// <param name="dirty">Should the scene be marked as clean or dirty.</param>
  366. internal static void SetSceneDirty(bool dirty)
  367. {
  368. sceneDirty = dirty;
  369. SetStatusScene(Scene.ActiveSceneName, dirty);
  370. if (!dirty)
  371. dirtyResources.Remove(Scene.ActiveSceneUUID);
  372. }
  373. /// <summary>
  374. /// Checks is the specific resource dirty and needs saving.
  375. /// </summary>
  376. /// <param name="resource">Resource to check.</param>
  377. /// <returns>True if the resource requires saving, false otherwise.</returns>
  378. public static bool IsDirty(Resource resource)
  379. {
  380. return dirtyResources.Contains(resource.UUID);
  381. }
  382. /// <summary>
  383. /// Triggered when <see cref="LoadProject"/> method completes.
  384. /// </summary>
  385. private static void OnProjectLoaded()
  386. {
  387. SetStatusProject(false);
  388. if (!unitTestsExecuted)
  389. {
  390. RunUnitTests();
  391. unitTestsExecuted = true;
  392. }
  393. if (!IsProjectLoaded)
  394. {
  395. ProjectWindow.Open();
  396. return;
  397. }
  398. string projectPath = ProjectPath;
  399. RecentProject[] recentProjects = EditorSettings.RecentProjects;
  400. bool foundPath = false;
  401. for (int i = 0; i < recentProjects.Length; i++)
  402. {
  403. if (PathEx.Compare(recentProjects[i].path, projectPath))
  404. {
  405. recentProjects[i].accessTimestamp = (ulong)DateTime.Now.Ticks;
  406. EditorSettings.RecentProjects = recentProjects;
  407. foundPath = true;
  408. break;
  409. }
  410. }
  411. if (!foundPath)
  412. {
  413. List<RecentProject> extendedRecentProjects = new List<RecentProject>();
  414. extendedRecentProjects.AddRange(recentProjects);
  415. RecentProject newProject = new RecentProject();
  416. newProject.path = projectPath;
  417. newProject.accessTimestamp = (ulong)DateTime.Now.Ticks;
  418. extendedRecentProjects.Add(newProject);
  419. EditorSettings.RecentProjects = extendedRecentProjects.ToArray();
  420. }
  421. EditorSettings.LastOpenProject = projectPath;
  422. EditorSettings.Save();
  423. ProjectLibrary.Refresh();
  424. monitor = new FolderMonitor(ProjectLibrary.ResourceFolder);
  425. monitor.OnAdded += OnAssetModified;
  426. monitor.OnRemoved += OnAssetModified;
  427. monitor.OnModified += OnAssetModified;
  428. if (!string.IsNullOrWhiteSpace(ProjectSettings.LastOpenScene))
  429. {
  430. Scene.Load(ProjectSettings.LastOpenScene);
  431. SetSceneDirty(false);
  432. }
  433. }
  434. /// <summary>
  435. /// Unloads the currently loaded project. Offers the user a chance to save the current scene if it is modified.
  436. /// Automatically saves all project data before unloading.
  437. /// </summary>
  438. private static void UnloadProject()
  439. {
  440. Action continueUnload =
  441. () =>
  442. {
  443. Scene.Clear();
  444. if (monitor != null)
  445. {
  446. monitor.Destroy();
  447. monitor = null;
  448. }
  449. LibraryWindow window = EditorWindow.GetWindow<LibraryWindow>();
  450. if(window != null)
  451. window.Reset();
  452. SetSceneDirty(false);
  453. Internal_UnloadProject();
  454. SetStatusProject(false);
  455. };
  456. Action<DialogBox.ResultType> dialogCallback =
  457. (result) =>
  458. {
  459. if (result == DialogBox.ResultType.Yes)
  460. SaveScene();
  461. continueUnload();
  462. };
  463. if (IsSceneModified())
  464. {
  465. DialogBox.Open("Warning", "You current scene has modifications. Do you wish to save them first?",
  466. DialogBox.Type.YesNoCancel, dialogCallback);
  467. }
  468. else
  469. continueUnload();
  470. }
  471. /// <summary>
  472. /// Reloads all script assemblies in case they were modified. This action is delayed and will be executed
  473. /// at the beginning of the next frame.
  474. /// </summary>
  475. public static void ReloadAssemblies()
  476. {
  477. Internal_ReloadAssemblies();
  478. }
  479. /// <summary>
  480. /// Changes the scene displayed on the status bar.
  481. /// </summary>
  482. /// <param name="name">Name of the scene.</param>
  483. /// <param name="modified">Whether to display the scene as modified or not.</param>
  484. private static void SetStatusScene(string name, bool modified)
  485. {
  486. Internal_SetStatusScene(name, modified);
  487. }
  488. /// <summary>
  489. /// Changes the project state displayed on the status bar.
  490. /// </summary>
  491. /// <param name="modified">Whether to display the project as modified or not.</param>
  492. private static void SetStatusProject(bool modified)
  493. {
  494. Internal_SetStatusProject(modified);
  495. }
  496. /// <summary>
  497. /// Displays or hides the "compilation in progress" visual on the status bar.
  498. /// </summary>
  499. /// <param name="compiling">True to display the visual, false otherwise.</param>
  500. internal static void SetStatusCompiling(bool compiling)
  501. {
  502. Internal_SetStatusCompiling(compiling);
  503. }
  504. /// <summary>
  505. /// Checks did we make any modifications to the scene since it was last saved.
  506. /// </summary>
  507. /// <returns>True if the scene was never saved, or was modified after last save.</returns>
  508. public static bool IsSceneModified()
  509. {
  510. return sceneDirty;
  511. }
  512. /// <summary>
  513. /// Executes any editor-specific unit tests. This should be called after a project is loaded if possible.
  514. /// </summary>
  515. private static void RunUnitTests()
  516. {
  517. #if DEBUG
  518. Internal_RunUnitTests();
  519. #endif
  520. }
  521. [MethodImpl(MethodImplOptions.InternalCall)]
  522. private static extern void Internal_SetStatusScene(string name, bool modified);
  523. [MethodImpl(MethodImplOptions.InternalCall)]
  524. private static extern void Internal_SetStatusProject(bool modified);
  525. [MethodImpl(MethodImplOptions.InternalCall)]
  526. private static extern void Internal_SetStatusCompiling(bool compiling);
  527. [MethodImpl(MethodImplOptions.InternalCall)]
  528. private static extern string Internal_GetProjectPath();
  529. [MethodImpl(MethodImplOptions.InternalCall)]
  530. private static extern string Internal_GetProjectName();
  531. [MethodImpl(MethodImplOptions.InternalCall)]
  532. private static extern bool Internal_GetProjectLoaded();
  533. [MethodImpl(MethodImplOptions.InternalCall)]
  534. private static extern string Internal_GetCompilerPath();
  535. [MethodImpl(MethodImplOptions.InternalCall)]
  536. private static extern string Internal_GetBuiltinAssemblyPath();
  537. [MethodImpl(MethodImplOptions.InternalCall)]
  538. private static extern string Internal_GetScriptAssemblyPath();
  539. [MethodImpl(MethodImplOptions.InternalCall)]
  540. private static extern string Internal_GetFrameworkAssemblyPath();
  541. [MethodImpl(MethodImplOptions.InternalCall)]
  542. private static extern string Internal_GetEngineAssemblyName();
  543. [MethodImpl(MethodImplOptions.InternalCall)]
  544. private static extern string Internal_GetEditorAssemblyName();
  545. [MethodImpl(MethodImplOptions.InternalCall)]
  546. private static extern string Internal_GetScriptGameAssemblyName();
  547. [MethodImpl(MethodImplOptions.InternalCall)]
  548. private static extern string Internal_GetScriptEditorAssemblyName();
  549. [MethodImpl(MethodImplOptions.InternalCall)]
  550. private static extern string Internal_SaveScene(string path);
  551. [MethodImpl(MethodImplOptions.InternalCall)]
  552. private static extern bool Internal_IsValidProject(string path);
  553. [MethodImpl(MethodImplOptions.InternalCall)]
  554. private static extern void Internal_SaveProject();
  555. [MethodImpl(MethodImplOptions.InternalCall)]
  556. private static extern void Internal_LoadProject(string path);
  557. [MethodImpl(MethodImplOptions.InternalCall)]
  558. private static extern void Internal_UnloadProject();
  559. [MethodImpl(MethodImplOptions.InternalCall)]
  560. private static extern void Internal_CreateProject(string path);
  561. [MethodImpl(MethodImplOptions.InternalCall)]
  562. private static extern void Internal_ReloadAssemblies();
  563. [MethodImpl(MethodImplOptions.InternalCall)]
  564. private static extern void Internal_OpenExternally(string path);
  565. [MethodImpl(MethodImplOptions.InternalCall)]
  566. private static extern void Internal_RunUnitTests();
  567. }
  568. }