GUISceneTreeView.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using BansheeEngine;
  4. namespace BansheeEditor
  5. {
  6. /// <summary>
  7. /// GUI element that displays all scene objects in the current scene as a tree view.
  8. /// </summary>
  9. public sealed class GUISceneTreeView : GUIElement
  10. {
  11. /// <summary>
  12. /// Creates a new scene tree view element.
  13. /// </summary>
  14. /// <param name="style">Optional style to use for the element. Style controls the look of the element, as well as
  15. /// default layout options. Style will be retrieved from the active GUISkin. If not specified
  16. /// default element style is used.</param>
  17. /// <param name="options">Options that allow you to control how is the element positioned and sized. This will
  18. /// override any similar options set by style.</param>
  19. public GUISceneTreeView(string style = "", params GUIOption[] options)
  20. {
  21. Internal_CreateInstance(this, style, options);
  22. }
  23. /// <summary>
  24. /// Creates a new scene tree view element.
  25. /// </summary>
  26. /// <param name="options">Options that allow you to control how is the element positioned and sized. This will
  27. /// override any similar options set by style.</param>
  28. public GUISceneTreeView(params GUIOption[] options)
  29. {
  30. Internal_CreateInstance(this, "", options);
  31. }
  32. /// <summary>
  33. /// Updates the contents of the tree view with most recent scene data. Should be called once per frame.
  34. /// </summary>
  35. public void Update()
  36. {
  37. Internal_Update(mCachedPtr);
  38. }
  39. [MethodImpl(MethodImplOptions.InternalCall)]
  40. private static extern void Internal_CreateInstance(GUISceneTreeView instance, string style, GUIOption[] options);
  41. [MethodImpl(MethodImplOptions.InternalCall)]
  42. private static extern void Internal_Update(IntPtr thisPtr);
  43. }
  44. }