Version: 5.4
public static void DotCap (int controlID, Vector3 position, Quaternion rotation, float size);

パラメーター

controlID ハンドルのコントロール ID
position ハンドルを開始するワールドスペースの位置
rotation ハンドルの回転
size ワールドスペースユニットでのハンドルのサイズ

説明

カメラに面しているドットを描き、これをハンドル関数に渡します。

注意: 画面サイズに対して固定サイズのハンドルを持ちたい場合、HandleUtility.GetHandleSize を使用します。


Dot Cap in the Scene view.

この例を使用するには、以下のスクリプトを Assets/Editor フォルダーに保存します。

using UnityEngine;
using UnityEditor;

[CustomEditor( typeof( DummyDotCap ) )] public class DotCapEditor : Editor { public float dotSize = 1;

void OnSceneGUI( ) { DummyDotCap t = target as DummyDotCap;

Handles.color = Color.red; Handles.DotCap( 0, t.transform.position + new Vector3( 5, 0, 0 ), t.transform.rotation, dotSize );

Handles.color = Color.green; Handles.DotCap( 0, t.transform.position + new Vector3( 0, 5, 0 ), t.transform.rotation, dotSize );

Handles.color = Color.blue; Handles.DotCap( 0, t.transform.position + new Vector3( 0, 0, 5 ), t.transform.rotation, dotSize ); } }

このスクリプトをドット (Dot) のハンドルを設定したいオブジェクトにアタッチします。

using UnityEngine;

[ExecuteInEditMode] public class DummyDotCap : MonoBehaviour { public void Start( ) { Debug.Log( "I have DotCap Handles attached to this transform!" ); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961