EditorApplication.cs 26 KB

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