Program.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections.Generic;
  3. using BansheeEngine;
  4. namespace BansheeEditor
  5. {
  6. /// <summary>
  7. /// Entry point to the editor.
  8. /// </summary>
  9. class Program
  10. {
  11. private static EditorApplication app;
  12. /// <summary>
  13. /// Called by the runtime whenever the editor assembly is loaded. This means initially when editor is started
  14. /// and every time assembly refresh occurs.
  15. /// </summary>
  16. static void OnInitialize()
  17. {
  18. app = new EditorApplication();
  19. }
  20. /// <summary>
  21. /// Called by the runtime when the editor is first started. Called after <see cref="OnInitialize"/>.
  22. /// </summary>
  23. static void OnEditorLoad()
  24. {
  25. if (EditorSettings.AutoLoadLastProject)
  26. {
  27. string projectPath = EditorSettings.LastOpenProject;
  28. if (EditorApplication.IsValidProject(projectPath))
  29. EditorApplication.LoadProject(projectPath);
  30. else
  31. ProjectWindow.Open();
  32. }
  33. else
  34. ProjectWindow.Open();
  35. }
  36. /// <summary>
  37. /// Called 60 times per second by the runtime.
  38. /// </summary>
  39. static void OnEditorUpdate()
  40. {
  41. app.OnEditorUpdate();
  42. }
  43. }
  44. }