static function DrawGizmo (gizmo : GizmoType) : DrawGizmo
Description
Defines when the gizmo should be invoked for drawing.
See Also: GizmoType
@DrawGizmo (GizmoType.NotSelected | GizmoType.Pickable)
static function RenderLightGizmo (light : Light, gizmoType : GizmoType) {
var position = light.transform.position;
Gizmos.DrawIcon (position + Vector3.up, "Light Gizmo.tiff");
if ((gizmoType & GizmoType.SelectedOrChild) != 0) {
if ((gizmoType & GizmoType.Active) != 0)
Gizmos.color = Color.red;
else
Gizmos.color = Color.red * 0.5;
Gizmos.DrawSphere (position, light.range);
}
}
using UnityEditor;
using UnityEngine;
class GizmoTest {
[DrawGizmo (GizmoType.NotSelected | GizmoType.Pickable)]
static void RenderLightGizmo (Light light, GizmoType gizmoType) {
Vector3 position = light.transform.position;
Gizmos.DrawIcon (position + Vector3.up, "Light Gizmo.tiff");
if ((gizmoType & GizmoType.SelectedOrChild) != 0) {
if ((gizmoType & GizmoType.Active) != 0)
Gizmos.color = Color.red;
else
Gizmos.color = Color.red * 0.5F;
Gizmos.DrawSphere (position, light.range);
}
}
}
static function DrawGizmo (gizmo : GizmoType, drawnGizmoType : Type) : DrawGizmo
Description
Same as above. drawnGizmoType determines of what type the object we are drawing the gizmo of has to be.
If drawnGizmoType is null, the type will be determined from the first parameter of the draw gizmo method.