言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

DrawGizmo.DrawGizmo

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public function DrawGizmo(gizmo: GizmoType)
public DrawGizmo(GizmoType gizmo);
public def DrawGizmo(gizmo as GizmoType)

Parameters

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

Description

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 function DrawGizmo(gizmo: GizmoType, drawnGizmoType: Type)
public DrawGizmo(GizmoType gizmo, Type drawnGizmoType);
public def DrawGizmo(gizmo as GizmoType, drawnGizmoType as Type)

Parameters

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

Description

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

もし drawnGizmoType が null である場合、型は DrawGizmo メソッドの最初のパラメータにより決定されます。 もし drawnGizmoType が null である場合、型は同じ型、派生型、DrawGizmoメソッドの最初のパラメータにより決定されます。