FieldSelectionWindow.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. using System;
  4. using BansheeEngine;
  5. namespace BansheeEditor
  6. {
  7. /** @addtogroup Library
  8. * @{
  9. */
  10. [DefaultSize(250, 350)]
  11. internal class FieldSelectionWindow : DropDownWindow
  12. {
  13. private GUIFieldSelector guiFieldSelector;
  14. public Action<string, SerializableProperty.FieldType> OnFieldSelected;
  15. /// <summary>
  16. /// Constructs the drop down window.
  17. /// </summary>
  18. public FieldSelectionWindow()
  19. {
  20. guiFieldSelector = new GUIFieldSelector(GUI, Selection.SceneObject, Width, Height);
  21. guiFieldSelector.OnElementSelected += (so, comp, path, type) =>
  22. {
  23. OnFieldSelected?.Invoke(path, type);
  24. Close();
  25. };
  26. }
  27. }
  28. /** @} */
  29. }