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

パラメーター

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

説明

Move ツールで使用されるような Arrow を描画します。

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


Arrow Cap in the Scene View.

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

using UnityEngine;
using UnityEditor;

[CustomEditor( typeof( DummyArrowCap ) )] public class ArrowCapEditor : Editor { public float arrowSize = 1;

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

Handles.color = Handles.xAxisColor; Handles.ArrowCap( 0, t.transform.position, t.transform.rotation * Quaternion.Euler( 0, 90, 0 ), arrowSize );

Handles.color = Handles.yAxisColor; Handles.ArrowCap( 0, t.transform.position, t.transform.rotation * Quaternion.Euler( -90, 0, 0 ), arrowSize );

Handles.color = Handles.zAxisColor; Handles.ArrowCap( 0, t.transform.position, t.transform.rotation, arrowSize ); } }

そして、このスクリプトを Arrow Cap を表示したいオブジェクトに置きます。

using UnityEngine;

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