SquarePivotPointRenderer.cs 662 B

123456789101112131415161718192021
  1. #if UNITY_EDITOR
  2. using UnityEngine;
  3. namespace O3DWB
  4. {
  5. public class SquarePivotPointRenderer : 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. Square2D square = new Square2D(screenPoint, sizeInPixels);
  13. GizmosEx.Render2DFilledSquare(square, fillColor);
  14. GizmosEx.Render2DSquareBorderLines(square, borderLineColor);
  15. }
  16. #endregion
  17. }
  18. }
  19. #endif