IGUIState.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using UnityEngine;
  2. using UnityEditor;
  3. namespace UnityEditor.U2D.Path.GUIFramework
  4. {
  5. public struct SliderData
  6. {
  7. public Vector3 position;
  8. public Vector3 forward;
  9. public Vector3 up;
  10. public Vector3 right;
  11. public static readonly SliderData zero = new SliderData() { position = Vector3.zero, forward = Vector3.forward, up = Vector3.up, right = Vector3.right };
  12. }
  13. public interface IGUIState
  14. {
  15. Vector2 mousePosition { get; }
  16. int mouseButton { get; }
  17. int clickCount { get; set; }
  18. bool isShiftDown { get; }
  19. bool isAltDown { get; }
  20. bool isActionKeyDown { get; }
  21. KeyCode keyCode { get; }
  22. EventType eventType { get; }
  23. string commandName { get; }
  24. int nearestControl { get; set; }
  25. int hotControl { get; set; }
  26. bool changed { get; set; }
  27. int GetControlID(int hint, FocusType focusType);
  28. void AddControl(int controlID, float distance);
  29. bool Slider(int id, SliderData sliderData, out Vector3 newPosition);
  30. void UseEvent();
  31. void Repaint();
  32. bool HasCurrentCamera();
  33. float GetHandleSize(Vector3 position);
  34. float DistanceToSegment(Vector3 p1, Vector3 p2);
  35. float DistanceToCircle(Vector3 center, float radius);
  36. Vector3 GUIToWorld(Vector2 guiPosition, Vector3 planeNormal, Vector3 planePos);
  37. }
  38. }