Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

Gizmos.DrawIcon

マニュアルに切り替える
public static void DrawIcon(Vector3 center, string name, bool allowScaling = true);
public static void DrawIcon(Vector3 center, string name, bool allowScaling = true);

パラメーター

説明

シーンビューにアイコンを描画します

アイコンの画像ファイル名は name パラメーターで指定され、 center パラメーターはワールド空間内のアイコンの場所を示し、 allowScaling パラメーターはアイコンを拡大縮小できるかを判断します。 画像ファイルは Assets/Gizmos フォルダーに配置する必要があります。

DrawIcon はゲームで重要なオブジェクトを迅速に選択するために使用できます。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void OnDrawGizmos() { Gizmos.DrawIcon(transform.position, "Light Gizmo.tiff", true); } }