Preview3D.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #if false
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using UnityEngine;
  7. using UnityEngine.UIElements;
  8. using UnityEditor.UIElements;
  9. using UnityEditor.Experimental.GraphView;
  10. namespace UnityEditor.VFX.UI
  11. {
  12. /* class Preview3DController : SimpleElementPresenter
  13. {
  14. public Preview3DController()
  15. {
  16. title = "3D Preview";
  17. position = new Rect(100, 100, 300, 300);
  18. }
  19. public new void OnEnable()
  20. {
  21. base.OnEnable();
  22. capabilities |= Capabilities.Movable | Capabilities.Resizable;
  23. }
  24. }*/
  25. class Preview3D : GraphElement
  26. {
  27. Label m_Label;
  28. Element3D m_Element;
  29. public Preview3D()
  30. {
  31. style.flexDirection = FlexDirection.Column;
  32. style.alignItems = Align.Stretch;
  33. m_Label = new Label();
  34. Add(m_Label);
  35. m_Element = new Element3D();
  36. Add(m_Element);
  37. m_Element.style.flex = 1;
  38. style.width = style.height = 300;
  39. m_Element.AddManipulator(new Rotate3DManipulator(m_Element));
  40. }
  41. /*
  42. public void OnDataChanged()
  43. {
  44. base.OnDataChanged();
  45. Preview3DController controller = GetPresenter<Preview3DController>();
  46. m_Label.text = controller.title;
  47. }
  48. */
  49. }
  50. }
  51. #endif