EditorBuiltin.cs 7.8 KB

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