EditorBuiltin.cs 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. using System.Runtime.CompilerServices;
  4. using BansheeEngine;
  5. namespace BansheeEditor
  6. {
  7. /** @addtogroup Utility-Editor
  8. * @{
  9. */
  10. /// <summary>
  11. /// Types of icons that may be displayed on the tool bar.
  12. /// </summary>
  13. public enum ToolbarIcon // Note: Must match C++ enum ToolbarIcon
  14. {
  15. NewCamera, NewRenderable, NewPointLight, NewDirLight, NewSpotLight, NewSceneObject, NewCube, NewSphere, NewCone,
  16. NewQuad, NewMat, NewCSScript, NewShader, NewSpriteTex, Pause, Play, Step, Undo, Redo, OpenProject, SaveProject,
  17. SaveScene
  18. }
  19. /// <summary>
  20. /// Types of icons that may be displayed in the scene window.
  21. /// </summary>
  22. public enum SceneWindowIcon // Note: Must match C++ enum SceneWindowIcon
  23. {
  24. View, Move, Rotate, Scale, Pivot, Center, Local, World, MoveSnap, RotateSnap
  25. }
  26. /// <summary>
  27. /// Types of icons that may be displayed in the library window.
  28. /// </summary>
  29. public enum LibraryWindowIcon // Note: Must match C++ enum LibraryWindowIcon
  30. {
  31. Home, Up, Clear, Options
  32. }
  33. /// <summary>
  34. /// Types of icons that may be displayed in the inspector window.
  35. /// </summary>
  36. public enum InspectorWindowIcon // Note: Must match C++ enum InspectorWindowIcon
  37. {
  38. Create, Clone, Clear, Resize, Delete, MoveUp, MoveDown, Edit, Apply, Add, Cancel
  39. }
  40. /// <summary>
  41. /// Types of icons that may be displayed for resources in the library window.
  42. /// </summary>
  43. public enum LibraryItemIcon // Note: Must match C++ enum ProjectIcon
  44. {
  45. Folder, Mesh, Font, Texture, PlainText, ScriptCode, SpriteTexture, Shader, ShaderInclude, Material, Prefab, GUISkin,
  46. PhysicsMaterial, PhysicsMesh, AudioClip, AnimationClip
  47. }
  48. /// <summary>
  49. /// Types of icons that may be displayed in the animation editor window.
  50. /// </summary>
  51. public enum AnimationWindowIcon // Note: Must match C++ enum AnimationWindowIcon
  52. {
  53. Play, Record, FrameForward, FrameBack, AddKeyframe, AddEvent, Keyframe, Event
  54. };
  55. /// <summary>
  56. /// Types of icons that can be used for displaying types of log messages.
  57. /// </summary>
  58. public enum LogIcon // Note: Must match C++ enum LogMessageIcon
  59. {
  60. Info, Warning, Error
  61. }
  62. /// <summary>
  63. /// Types of icons used in various areas throughout the editor.
  64. /// </summary>
  65. public enum EditorIcon // Note: Must match C++ enum EditorIcon
  66. {
  67. X, Component, SceneObject
  68. }
  69. /// <summary>
  70. /// Contains various editor-specific resources that are always available.
  71. /// </summary>
  72. public static class EditorBuiltin
  73. {
  74. /// <summary>Returns text contained in the default "empty" shader.</summary>
  75. public static string EmptyShaderCode { get { return Internal_GetEmptyShaderCode(); } }
  76. /// <summary>Returns text contained in the default "empty" C# script.</summary>
  77. public static string EmptyCSScriptCode { get { return Internal_GetEmptyCSScriptCode(); } }
  78. /// <summary>
  79. /// Returns the default Font used in the editor.
  80. /// </summary>
  81. public static Font DefaultFont
  82. {
  83. get { return Internal_GetDefaultFont(); }
  84. }
  85. /// <summary>
  86. /// Returns the default GUI skin used in the editor.
  87. /// </summary>
  88. public static GUISkin GUISkin
  89. {
  90. get { return Internal_GetGUISkin(); }
  91. }
  92. /// <summary>
  93. /// Retrieves an icon used for displaying an entry in the library window.
  94. /// </summary>
  95. /// <param name="icon">Type of the icon to retrieve.</param>
  96. /// <param name="size">Size of the icon to retrieve in pixels. This will be rounded
  97. /// to nearest available size.</param>
  98. /// <returns>Sprite texture of the icon.</returns>
  99. public static SpriteTexture GetLibraryItemIcon(LibraryItemIcon icon, int size)
  100. {
  101. return Internal_GetLibraryItemIcon(icon, size);
  102. }
  103. /// <summary>
  104. /// Retrieves an icon that may be displayed on the main window's toolbar.
  105. /// </summary>
  106. /// <param name="icon">Type of icon to retrieve.</param>
  107. /// <returns>Sprite texture of the icon.</returns>
  108. public static SpriteTexture GetToolbarIcon(ToolbarIcon icon)
  109. {
  110. return Internal_GetToolbarIcon(icon);
  111. }
  112. /// <summary>
  113. /// Retrieves an icon that may be displayed on the library window.
  114. /// </summary>
  115. /// <param name="icon">Type of icon to retrieve.</param>
  116. /// <returns>Sprite texture of the icon.</returns>
  117. public static SpriteTexture GetLibraryWindowIcon(LibraryWindowIcon icon)
  118. {
  119. return Internal_GetLibraryWindowIcon(icon);
  120. }
  121. /// <summary>
  122. /// Retrieves an icon that may be displayed on the inspector window.
  123. /// </summary>
  124. /// <param name="icon">Type of icon to retrieve.</param>
  125. /// <returns>Sprite texture of the icon.</returns>
  126. public static SpriteTexture GetInspectorWindowIcon(InspectorWindowIcon icon)
  127. {
  128. return Internal_GetInspectorWindowIcon(icon);
  129. }
  130. /// <summary>
  131. /// Retrieves an icon that may be displayed on the scene window.
  132. /// </summary>
  133. /// <param name="icon">Type of icon to retrieve.</param>
  134. /// <returns>Sprite textures of the icon.</returns>
  135. public static GUIContentImages GetSceneWindowIcon(SceneWindowIcon icon)
  136. {
  137. return Internal_GetSceneWindowIcon(icon);
  138. }
  139. /// <summary>
  140. /// Retrieves an icon that may be displayed on the animation window.
  141. /// </summary>
  142. /// <param name="icon">Type of icon to retrieve.</param>
  143. /// <returns>Sprite textures of the icon.</returns>
  144. public static GUIContentImages GetAnimationWindowIcon(AnimationWindowIcon icon)
  145. {
  146. return Internal_GetAnimationWindowIcon(icon);
  147. }
  148. /// <summary>
  149. /// Retrieves an icon that represents different types of log entries.
  150. /// </summary>
  151. /// <param name="icon">Type of icon to retrieve.</param>
  152. /// <param name="size">Size of the icon in pixels. Nearest available size will be returned.</param>
  153. /// <param name="dark">Controls should the dark or light version of the icon be returned.</param>
  154. /// <returns>Sprite texture of the icon.</returns>
  155. public static SpriteTexture GetLogIcon(LogIcon icon, int size, bool dark)
  156. {
  157. return Internal_GetLogIcon(icon, size, dark);
  158. }
  159. /// <summary>
  160. /// Retrieves an icon used throughout the editor.
  161. /// </summary>
  162. /// <param name="icon">Type of icon to retrieve.</param>
  163. /// <returns>Sprite texture of the icon.</returns>
  164. public static SpriteTexture GetEditorIcon(EditorIcon icon)
  165. {
  166. return Internal_GetEditorIcon(icon);
  167. }
  168. [MethodImpl(MethodImplOptions.InternalCall)]
  169. private static extern SpriteTexture Internal_GetLibraryItemIcon(LibraryItemIcon icon, int size);
  170. [MethodImpl(MethodImplOptions.InternalCall)]
  171. private static extern string Internal_GetEmptyShaderCode();
  172. [MethodImpl(MethodImplOptions.InternalCall)]
  173. private static extern string Internal_GetEmptyCSScriptCode();
  174. [MethodImpl(MethodImplOptions.InternalCall)]
  175. private static extern SpriteTexture Internal_GetToolbarIcon(ToolbarIcon icon);
  176. [MethodImpl(MethodImplOptions.InternalCall)]
  177. private static extern SpriteTexture Internal_GetLibraryWindowIcon(LibraryWindowIcon icon);
  178. [MethodImpl(MethodImplOptions.InternalCall)]
  179. private static extern SpriteTexture Internal_GetInspectorWindowIcon(InspectorWindowIcon icon);
  180. [MethodImpl(MethodImplOptions.InternalCall)]
  181. private static extern GUIContentImages Internal_GetSceneWindowIcon(SceneWindowIcon icon);
  182. [MethodImpl(MethodImplOptions.InternalCall)]
  183. private static extern GUIContentImages Internal_GetAnimationWindowIcon(AnimationWindowIcon icon);
  184. [MethodImpl(MethodImplOptions.InternalCall)]
  185. private static extern SpriteTexture Internal_GetLogIcon(LogIcon icon, int size, bool dark);
  186. [MethodImpl(MethodImplOptions.InternalCall)]
  187. private static extern SpriteTexture Internal_GetEditorIcon(EditorIcon icon);
  188. [MethodImpl(MethodImplOptions.InternalCall)]
  189. private static extern Font Internal_GetDefaultFont();
  190. [MethodImpl(MethodImplOptions.InternalCall)]
  191. private static extern GUISkin Internal_GetGUISkin();
  192. }
  193. /** @} */
  194. }