EditorBuiltin.cs 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. using System.Runtime.CompilerServices;
  2. using BansheeEngine;
  3. namespace BansheeEditor
  4. {
  5. /// <summary>
  6. /// Types of icons that may be displayed on the tool bar.
  7. /// </summary>
  8. public enum ToolbarIcon // Note: Must match C++ enum ToolbarIcon
  9. {
  10. NewCamera, NewRenderable, NewPointLight, NewDirLight, NewSpotLight, NewSceneObject, NewCube, NewSphere, NewCone,
  11. NewQuad, NewMat, NewCSScript, NewShader, NewSpriteTex, Pause, Play, Step, Undo, Redo, OpenProject, SaveProject,
  12. SaveScene
  13. };
  14. /// <summary>
  15. /// Types of icons that may be displayed in the scene window.
  16. /// </summary>
  17. public enum SceneWindowIcon // Note: Must match C++ enum SceneWindowIcon
  18. {
  19. View, Move, Rotate, Scale, Pivot, Center, Local, World, MoveSnap, RotateSnap
  20. };
  21. /// <summary>
  22. /// Types of icons that may be displayed in the library window.
  23. /// </summary>
  24. public enum LibraryWindowIcon // Note: Must match C++ enum LibraryWindowIcon
  25. {
  26. Home, Up, Clear, Options
  27. };
  28. /// <summary>
  29. /// Types of icons that may be displayed in the inspector window.
  30. /// </summary>
  31. public enum InspectorWindowIcon // Note: Must match C++ enum InspectorWindowIcon
  32. {
  33. Create, Clone, Clear, Resize, Delete, MoveUp, MoveDown, Edit, Apply, Add, Cancel
  34. };
  35. /// <summary>
  36. /// Contains various editor-specific resources that are always available.
  37. /// </summary>
  38. public static class EditorBuiltin
  39. {
  40. /// <summary>Icon used for displaying folders in the library window.</summary>
  41. public static SpriteTexture FolderIcon { get { return Internal_GetFolderIcon(); } }
  42. /// <summary>Icon used for displaying mesh resources in the library window.</summary>
  43. public static SpriteTexture MeshIcon { get { return Internal_GetMeshIcon(); } }
  44. /// <summary>Icon used for displaying font resources in the library window.</summary>
  45. public static SpriteTexture FontIcon { get { return Internal_GetFontIcon(); } }
  46. /// <summary>Icon used for displaying texture resources in the library window.</summary>
  47. public static SpriteTexture TextureIcon { get { return Internal_GetTextureIcon(); } }
  48. /// <summary>Icon used for displaying plain text resources in the library window.</summary>
  49. public static SpriteTexture PlainTextIcon { get { return Internal_GetPlainTextIcon(); } }
  50. /// <summary>Icon used for displaying script code resources in the library window.</summary>
  51. public static SpriteTexture ScriptCodeIcon { get { return Internal_GetScriptCodeIcon(); } }
  52. /// <summary>Icon used for displaying shader resources in the library window.</summary>
  53. public static SpriteTexture ShaderIcon { get { return Internal_GetShaderIcon(); } }
  54. /// <summary>Icon used for displaying shader include resources in the library window.</summary>
  55. public static SpriteTexture ShaderIncludeIcon { get { return Internal_GetShaderIncludeIcon(); } }
  56. /// <summary>Icon used for displaying material resources in the library window.</summary>
  57. public static SpriteTexture MaterialIcon { get { return Internal_GetMaterialIcon(); } }
  58. /// <summary>Icon used for displaying sprite texture resources in the library window.</summary>
  59. public static SpriteTexture SpriteTextureIcon { get { return Internal_GetSpriteTextureIcon(); } }
  60. /// <summary>Icon used for displaying prefab resources in the library window.</summary>
  61. public static SpriteTexture PrefabIcon { get { return Internal_GetPrefabIcon(); } }
  62. public static SpriteTexture XBtnIcon { get { return Internal_GetXBtnIcon(); } }
  63. /// <summary>Returns text contained in the default "empty" shader.</summary>
  64. public static string EmptyShaderCode { get { return Internal_GetEmptyShaderCode(); } }
  65. /// <summary>Returns text contained in the default "empty" C# script.</summary>
  66. public static string EmptyCSScriptCode { get { return Internal_GetEmptyCSScriptCode(); } }
  67. /// <summary>
  68. /// Retrieves an icon that may be displayed on the main window's toolbar.
  69. /// </summary>
  70. /// <param name="icon">Type of icon to retrieve.</param>
  71. /// <returns>Sprite texture of the icon.</returns>
  72. public static SpriteTexture GetToolbarIcon(ToolbarIcon icon)
  73. {
  74. return Internal_GetToolbarIcon(icon);
  75. }
  76. /// <summary>
  77. /// Retrieves an icon that may be displayed on the library window.
  78. /// </summary>
  79. /// <param name="icon">Type of icon to retrieve.</param>
  80. /// <returns>Sprite texture of the icon.</returns>
  81. public static SpriteTexture GetLibraryWindowIcon(LibraryWindowIcon icon)
  82. {
  83. return Internal_GetLibraryWindowIcon(icon);
  84. }
  85. /// <summary>
  86. /// Retrieves an icon that may be displayed on the inspector window.
  87. /// </summary>
  88. /// <param name="icon">Type of icon to retrieve.</param>
  89. /// <returns>Sprite texture of the icon.</returns>
  90. public static SpriteTexture GetInspectorWindowIcon(InspectorWindowIcon icon)
  91. {
  92. return Internal_GetInspectorWindowIcon(icon);
  93. }
  94. /// <summary>
  95. /// Retrieves an icon that may be displayed on the scene window.
  96. /// </summary>
  97. /// <param name="icon">Type of icon to retrieve.</param>
  98. /// <returns>Sprite texture of the icon.</returns>
  99. public static SpriteTexture GetSceneWindowIcon(SceneWindowIcon icon)
  100. {
  101. return Internal_GetSceneWindowIcon(icon);
  102. }
  103. [MethodImpl(MethodImplOptions.InternalCall)]
  104. private static extern SpriteTexture Internal_GetFolderIcon();
  105. [MethodImpl(MethodImplOptions.InternalCall)]
  106. private static extern SpriteTexture Internal_GetMeshIcon();
  107. [MethodImpl(MethodImplOptions.InternalCall)]
  108. private static extern SpriteTexture Internal_GetFontIcon();
  109. [MethodImpl(MethodImplOptions.InternalCall)]
  110. private static extern SpriteTexture Internal_GetTextureIcon();
  111. [MethodImpl(MethodImplOptions.InternalCall)]
  112. private static extern SpriteTexture Internal_GetPlainTextIcon();
  113. [MethodImpl(MethodImplOptions.InternalCall)]
  114. private static extern SpriteTexture Internal_GetScriptCodeIcon();
  115. [MethodImpl(MethodImplOptions.InternalCall)]
  116. private static extern SpriteTexture Internal_GetShaderIcon();
  117. [MethodImpl(MethodImplOptions.InternalCall)]
  118. private static extern SpriteTexture Internal_GetShaderIncludeIcon();
  119. [MethodImpl(MethodImplOptions.InternalCall)]
  120. private static extern SpriteTexture Internal_GetMaterialIcon();
  121. [MethodImpl(MethodImplOptions.InternalCall)]
  122. private static extern SpriteTexture Internal_GetSpriteTextureIcon();
  123. [MethodImpl(MethodImplOptions.InternalCall)]
  124. private static extern SpriteTexture Internal_GetPrefabIcon();
  125. [MethodImpl(MethodImplOptions.InternalCall)]
  126. private static extern SpriteTexture Internal_GetXBtnIcon();
  127. [MethodImpl(MethodImplOptions.InternalCall)]
  128. private static extern string Internal_GetEmptyShaderCode();
  129. [MethodImpl(MethodImplOptions.InternalCall)]
  130. private static extern string Internal_GetEmptyCSScriptCode();
  131. [MethodImpl(MethodImplOptions.InternalCall)]
  132. private static extern SpriteTexture Internal_GetToolbarIcon(ToolbarIcon icon);
  133. [MethodImpl(MethodImplOptions.InternalCall)]
  134. private static extern SpriteTexture Internal_GetLibraryWindowIcon(LibraryWindowIcon icon);
  135. [MethodImpl(MethodImplOptions.InternalCall)]
  136. private static extern SpriteTexture Internal_GetInspectorWindowIcon(InspectorWindowIcon icon);
  137. [MethodImpl(MethodImplOptions.InternalCall)]
  138. private static extern SpriteTexture Internal_GetSceneWindowIcon(SceneWindowIcon icon);
  139. }
  140. }