Beispiel #1
0
 public override void OnDrawGizmosSelected()
 {
     if (transform)
     {
         ZetanUtility.DrawGizmosCircle(transform.position, distance);
     }
 }
Beispiel #2
0
 private void OnDrawGizmosSelected()
 {
     if (gizmos && MapManager.Instance && !Application.isPlaying)
     {
         if (MapManager.Instance.MapMaskRect)
         {
             var rect = ZetanUtility.GetScreenSpaceRect(MapManager.Instance.MapMaskRect);
             Gizmos.DrawCube(MapManager.Instance.MapMaskRect.position, iconSize * rect.width / MapManager.Instance.MapMaskRect.rect.width);
             if (showRange)
             {
                 ZetanUtility.DrawGizmosCircle(MapManager.Instance.MapMaskRect.position, rangeSize * rect.width / MapManager.Instance.MapMaskRect.rect.width,
                                               Vector3.forward, rangeColor);
             }
         }
     }
 }
Beispiel #3
0
    private void OnDrawGizmos()
    {
        if (!UI || !UI.gameObject || !MapMaskRect)
        {
            return;
        }
        Rect screenSpaceRect = ZetanUtility.GetScreenSpaceRect(MapMaskRect);

        Vector3[] corners = new Vector3[4];
        UI.mapMaskRect.GetWorldCorners(corners);
        if (circle && !isViewingWorldMap)
        {
            float radius = (screenSpaceRect.width < screenSpaceRect.height ? screenSpaceRect.width : screenSpaceRect.height) * 0.5f * this.radius;
            //ZetanUtility.DrawGizmosCircle(ZetanUtility.CenterBetween(corners[0], corners[2]), radius, radius / 1000, Color.white, false);
            ZetanUtility.DrawGizmosCircle(ZetanUtility.CenterBetween(corners[0], corners[2]), radius, Vector3.forward);
        }
        else
        {
            float   edgeSize = isViewingWorldMap ? worldEdgeSize : this.edgeSize;
            Vector3 size     = new Vector3(screenSpaceRect.width - edgeSize * (screenSpaceRect.width < screenSpaceRect.height ? screenSpaceRect.width : screenSpaceRect.height),
                                           screenSpaceRect.height - edgeSize * (screenSpaceRect.width < screenSpaceRect.height ? screenSpaceRect.width : screenSpaceRect.height), 0);
            Gizmos.DrawWireCube(ZetanUtility.CenterBetween(corners[0], corners[2]), size);
        }
    }