Advertisement
apieceoffruit

Gizmo

Jul 15th, 2021
903
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. namespace JasonStorey
  4. {
  5.     public class Gizmo
  6.     {
  7.         private static GUIStyle _labelStyle;
  8.         protected static GUIStyle LabelStyle => _labelStyle ?? (_labelStyle = new GUIStyle());
  9.        
  10.         public static void DrawLabel(Vector3 position, string label) => DrawLabel(position, label, Color.white);
  11.        
  12.         public static void DrawLabel(Vector3 position, string label,Color color)
  13.         {
  14. #if UNITY_EDITOR
  15.             LabelStyle.normal.textColor = color;
  16.             UnityEditor.Handles.Label(position,label,_labelStyle);
  17. #endif
  18.         }
  19.     }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement