CirclePivotPointRenderer.cs 669 B

123456789101112131415161718192021
  1. #if UNITY_EDITOR
  2. using UnityEngine;
  3. namespace O3DWB
  4. {
  5. public class CirclePivotPointRenderer : IPivotPointRenderer
  6. {
  7. #region Public Methods
  8. public void Render(Vector3 pivotPoint, Color fillColor, Color borderLineColor, float sizeInPixels)
  9. {
  10. Camera camera = SceneViewCamera.Camera;
  11. Vector2 screenPoint = Vector3Extensions.WorldToScreenPoint(pivotPoint);
  12. Circle2D circle = new Circle2D(screenPoint, sizeInPixels * 0.5f);
  13. GizmosEx.Render2DFilledCircle(circle, fillColor);
  14. GizmosEx.Render2DCircleBorderLines(circle, borderLineColor);
  15. }
  16. #endregion
  17. }
  18. }
  19. #endif