Util_Editor_表示RectTransformのワールド座標と相対座標

UGUIを編集し、次のスクリプトを解決するための世界と相対座標未満の問題を見てください

[CustomEditor(typeof演算(RectTransform))]
 パブリック クラスMyRectTransformEditor:エディタ
{ 
    プライベートエディタエディタ。
    tagetTranformを変換。
    プライベート 無効OnEnable()
    { 
        エディタ = Editor.CreateEditor(ターゲット、Assembly.GetAssembly(typeof演算(編集))メソッドGetType(。" UnityEditor.RectTransformEditor ")); 
        tagetTranform =ターゲットとしてRectTransform。

    } 
    公共 オーバーライド ボイドOnInspectorGUI()
    { 
        editor.OnInspectorGUI();
        tagetTranform.position = EditorGUILayout.Vector3Field(" ワールド座標:" 、tagetTranform.position); 
        tagetTranform.localPosition = EditorGUILayout.Vector3Field(" 相対座標:" 、tagetTranform.localPosition); 
    } 
}

 

おすすめ

転載: www.cnblogs.com/PandaHome/p/10934820.html