public void OnEnable() { s_Instance = this; this.m_Position = base.serializedObject.FindProperty("m_LocalPosition"); this.m_Rotation = base.serializedObject.FindProperty("m_LocalRotation"); this.m_Scale = base.serializedObject.FindProperty("m_LocalScale"); if (this.m_RotationGUI == null) { string unityEditorPath = EditorApplication.applicationContentsPath + "/Managed/UnityEditor.dll"; Assembly assembly = Assembly.LoadFrom(unityEditorPath); Type rotationGUIType = assembly.GetType("UnityEditor.TransformRotationGUI"); ConstructorInfo rotationGUIConstructor = rotationGUIType.GetConstructor(new Type[0]); this.m_RotationGUI = rotationGUIConstructor.Invoke(null); m_RotationGUIFieldMethod = rotationGUIType.GetMethod("RotationField", new Type[0]); m_RotationGUIOnEnableMethod = rotationGUIType.GetMethod("OnEnable", new Type[] { typeof(SerializedProperty), typeof(GUIContent) }); } if (s_Contents == null) { s_Contents = new Contents(); } m_RotationGUIOnEnableMethod.Invoke(this.m_RotationGUI, new object[] { this.m_Rotation, s_Contents.anglesContent }); }
public void OnDestroy() { s_Instance = null; }