public static void ShowGizmo() { if (GizmoGO == null) { GetGizmo(); } GizmoGO.SetActive(true); GizmoSettings = GizmoGO.GetComponent <TerrainGizmos>(); GizmoEnabled = true; }
public static GameObject GetGizmo() { var obj = GameObject.Find(GizmoGOName); if (obj == null) { // create the gizmo GO GizmoGO = new GameObject(GizmoGOName); GizmoSettings = GizmoGO.AddComponent <TerrainGizmos>() as TerrainGizmos; } else { GizmoGO = obj; } return(GizmoGO); }