UnityEditor.TransformRotationGUI.OnEnable C# (CSharp) Method

OnEnable() public method

public OnEnable ( UnityEditor.SerializedProperty m_Rotation, GUIContent label ) : void
m_Rotation UnityEditor.SerializedProperty
label UnityEngine.GUIContent
return void
        public void OnEnable(SerializedProperty m_Rotation, GUIContent label)
        {
            this.m_Rotation = m_Rotation;
            this.targets = m_Rotation.serializedObject.targetObjects;
            this.m_OldRotationOrder = (this.targets[0] as Transform).rotationOrder;
            this.rotationContent = label;
        }

Usage Example

示例#1
0
        public void OnEnable()
        {
            m_Position = serializedObject.FindProperty("m_LocalPosition");
            m_Scale    = serializedObject.FindProperty("m_LocalScale");

            if (m_RotationGUI == null)
            {
                m_RotationGUI = new TransformRotationGUI();
            }
            m_RotationGUI.OnEnable(serializedObject.FindProperty("m_LocalRotation"), EditorGUIUtility.TrTextContent("Rotation", "The local rotation of this GameObject relative to the parent."));
        }
TransformRotationGUI