Version: 5.4

DrawGizmoConstructor

マニュアルに切り替える
public DrawGizmo (GizmoType gizmo);

パラメーター

gizmo Gizmo がいつ描画すべきか示すフラグ

説明

Gizmo が描画を実行するタイミングを定義します

See Also: GizmoType.

	/// The RenderLightGizmo function will be called if the light is not selected.
	/// The gizmo is drawn when picking.

@DrawGizmo (GizmoType.NotSelected | GizmoType.Pickable) static function RenderLightGizmo (light : Light, gizmoType : GizmoType) { var position = light.transform.position; // Draw the light icon // (A bit above the one drawn by the builtin light gizmo renderer) Gizmos.DrawIcon (position + Vector3.up, "Light Gizmo.tiff");

// Are we selected? Draw a solid sphere surrounding the light if ((gizmoType & GizmoType.SelectedOrChild) != 0) { // Indicate that this is the active object by using a brighter color. if ((gizmoType & GizmoType.Active) != 0) Gizmos.color = Color.red; else Gizmos.color = Color.red * 0.5; Gizmos.DrawSphere (position, light.range); } }

/* // Draw the gizmo if it is selected or a child of the selection. // This is the most common way to render a gizmo @DrawGizmo (GizmoType.SelectedOrChild)

// Draw the gizmo only if it is the active object. @DrawGizmo (GizmoType.Active)] */

public DrawGizmo (GizmoType gizmo, Type drawnGizmoType);

パラメーター

gizmo Gizmo がいつ描画すべきか示すフラグ
drawnGizmoType Gizmo を描画するオブジェクトがどの型であるか

説明

上記と同じです。drawnGizmoType は Gizmo を描画するオブジェクトがどの型とする必要があるか決定します。

If drawnGizmoType is null, the type will be determined from the first parameter of the draw gizmo method. If drawnGizmoType is not null, it must be the same type as, or a subtype of, the type of the first parameter.