EditorBuiltin.cs 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. /// Contains various editor-specific resources that are always available.
  29. /// </summary>
  30. public static class EditorBuiltin
  31. {
  32. /// <summary>Icon used for displaying folders in the library window.</summary>
  33. public static SpriteTexture FolderIcon { get { return Internal_GetFolderIcon(); } }
  34. /// <summary>Icon used for displaying mesh resources in the library window.</summary>
  35. public static SpriteTexture MeshIcon { get { return Internal_GetMeshIcon(); } }
  36. /// <summary>Icon used for displaying font resources in the library window.</summary>
  37. public static SpriteTexture FontIcon { get { return Internal_GetFontIcon(); } }
  38. /// <summary>Icon used for displaying texture resources in the library window.</summary>
  39. public static SpriteTexture TextureIcon { get { return Internal_GetTextureIcon(); } }
  40. /// <summary>Icon used for displaying plain text resources in the library window.</summary>
  41. public static SpriteTexture PlainTextIcon { get { return Internal_GetPlainTextIcon(); } }
  42. /// <summary>Icon used for displaying script code resources in the library window.</summary>
  43. public static SpriteTexture ScriptCodeIcon { get { return Internal_GetScriptCodeIcon(); } }
  44. /// <summary>Icon used for displaying shader resources in the library window.</summary>
  45. public static SpriteTexture ShaderIcon { get { return Internal_GetShaderIcon(); } }
  46. /// <summary>Icon used for displaying shader include resources in the library window.</summary>
  47. public static SpriteTexture ShaderIncludeIcon { get { return Internal_GetShaderIncludeIcon(); } }
  48. /// <summary>Icon used for displaying material resources in the library window.</summary>
  49. public static SpriteTexture MaterialIcon { get { return Internal_GetMaterialIcon(); } }
  50. /// <summary>Icon used for displaying sprite texture resources in the library window.</summary>
  51. public static SpriteTexture SpriteTextureIcon { get { return Internal_GetSpriteTextureIcon(); } }
  52. /// <summary>Icon used for displaying prefab resources in the library window.</summary>
  53. public static SpriteTexture PrefabIcon { get { return Internal_GetPrefabIcon(); } }
  54. public static SpriteTexture XBtnIcon { get { return Internal_GetXBtnIcon(); } }
  55. /// <summary>Returns text contained in the default "empty" shader.</summary>
  56. public static string EmptyShaderCode { get { return Internal_GetEmptyShaderCode(); } }
  57. /// <summary>Returns text contained in the default "empty" C# script.</summary>
  58. public static string EmptyCSScriptCode { get { return Internal_GetEmptyCSScriptCode(); } }
  59. /// <summary>
  60. /// Retrieves an icon that may be displayed on the main window's toolbar.
  61. /// </summary>
  62. /// <param name="icon">Type of icon to retrieve.</param>
  63. /// <returns>Sprite texture of the icon.</returns>
  64. public static SpriteTexture GetToolbarIcon(ToolbarIcon icon)
  65. {
  66. return Internal_GetToolbarIcon(icon);
  67. }
  68. /// <summary>
  69. /// Retrieves an icon that may be displayed on the library window.
  70. /// </summary>
  71. /// <param name="icon">Type of icon to retrieve.</param>
  72. /// <returns>Sprite texture of the icon.</returns>
  73. public static SpriteTexture GetLibraryWindowIcon(LibraryWindowIcon icon)
  74. {
  75. return Internal_LibraryWindowIcon(icon);
  76. }
  77. /// <summary>
  78. /// Retrieves an icon that may be displayed on the scene window.
  79. /// </summary>
  80. /// <param name="icon">Type of icon to retrieve.</param>
  81. /// <returns>Sprite texture of the icon.</returns>
  82. public static SpriteTexture GetSceneWindowIcon(SceneWindowIcon icon)
  83. {
  84. return Internal_GetSceneWindowIcon(icon);
  85. }
  86. [MethodImpl(MethodImplOptions.InternalCall)]
  87. private static extern SpriteTexture Internal_GetFolderIcon();
  88. [MethodImpl(MethodImplOptions.InternalCall)]
  89. private static extern SpriteTexture Internal_GetMeshIcon();
  90. [MethodImpl(MethodImplOptions.InternalCall)]
  91. private static extern SpriteTexture Internal_GetFontIcon();
  92. [MethodImpl(MethodImplOptions.InternalCall)]
  93. private static extern SpriteTexture Internal_GetTextureIcon();
  94. [MethodImpl(MethodImplOptions.InternalCall)]
  95. private static extern SpriteTexture Internal_GetPlainTextIcon();
  96. [MethodImpl(MethodImplOptions.InternalCall)]
  97. private static extern SpriteTexture Internal_GetScriptCodeIcon();
  98. [MethodImpl(MethodImplOptions.InternalCall)]
  99. private static extern SpriteTexture Internal_GetShaderIcon();
  100. [MethodImpl(MethodImplOptions.InternalCall)]
  101. private static extern SpriteTexture Internal_GetShaderIncludeIcon();
  102. [MethodImpl(MethodImplOptions.InternalCall)]
  103. private static extern SpriteTexture Internal_GetMaterialIcon();
  104. [MethodImpl(MethodImplOptions.InternalCall)]
  105. private static extern SpriteTexture Internal_GetSpriteTextureIcon();
  106. [MethodImpl(MethodImplOptions.InternalCall)]
  107. private static extern SpriteTexture Internal_GetPrefabIcon();
  108. [MethodImpl(MethodImplOptions.InternalCall)]
  109. private static extern SpriteTexture Internal_GetXBtnIcon();
  110. [MethodImpl(MethodImplOptions.InternalCall)]
  111. private static extern string Internal_GetEmptyShaderCode();
  112. [MethodImpl(MethodImplOptions.InternalCall)]
  113. private static extern string Internal_GetEmptyCSScriptCode();
  114. [MethodImpl(MethodImplOptions.InternalCall)]
  115. private static extern SpriteTexture Internal_GetToolbarIcon(ToolbarIcon icon);
  116. [MethodImpl(MethodImplOptions.InternalCall)]
  117. private static extern SpriteTexture Internal_LibraryWindowIcon(LibraryWindowIcon icon);
  118. [MethodImpl(MethodImplOptions.InternalCall)]
  119. private static extern SpriteTexture Internal_GetSceneWindowIcon(SceneWindowIcon icon);
  120. }
  121. }