Exemple #1
0
        public void OnEnable()
        {
            if (ParentConstraintEditor.s_Style == null)
            {
                ParentConstraintEditor.s_Style = new ParentConstraintEditor.Styles();
            }
            this.m_TranslationAtRest  = base.serializedObject.FindProperty("m_TranslationAtRest");
            this.m_TranslationOffsets = base.serializedObject.FindProperty("m_TranslationOffsets");
            this.m_RotationAtRest     = base.serializedObject.FindProperty("m_RotationAtRest");
            this.m_RotationOffsets    = base.serializedObject.FindProperty("m_RotationOffsets");
            this.m_Weight             = base.serializedObject.FindProperty("m_Weight");
            this.m_IsContraintActive  = base.serializedObject.FindProperty("m_IsContraintActive");
            this.m_IsLocked           = base.serializedObject.FindProperty("m_IsLocked");
            this.m_Sources            = base.serializedObject.FindProperty("m_Sources");
            this.m_OffsetList         = new ReorderableList(base.serializedObject, this.sources, false, false, false, false);
            ReorderableList expr_E6 = this.m_OffsetList;

            expr_E6.drawHeaderCallback = (ReorderableList.HeaderCallbackDelegate) Delegate.Combine(expr_E6.drawHeaderCallback, new ReorderableList.HeaderCallbackDelegate(delegate(Rect rect)
            {
                EditorGUI.LabelField(rect, ParentConstraintEditor.s_Style.SourceOffsets);
            }));
            ReorderableList expr_11E = this.m_OffsetList;

            expr_11E.drawElementCallback = (ReorderableList.ElementCallbackDelegate)Delegate.Combine(expr_11E.drawElementCallback, new ReorderableList.ElementCallbackDelegate(this.DrawOffsetElementCallback));
            ReorderableList expr_145 = this.m_OffsetList;

            expr_145.elementHeightCallback = (ReorderableList.ElementHeightCallbackDelegate)Delegate.Combine(expr_145.elementHeightCallback, new ReorderableList.ElementHeightCallbackDelegate(this.OnElementHeightCallback));
            base.OnEnable(ParentConstraintEditor.s_Style);
            this.m_OffsetList.index = base.selectedSourceIndex;
        }
Exemple #2
0
 public override void OnInspectorGUI()
 {
     if (ParentConstraintEditor.s_Style == null)
     {
         ParentConstraintEditor.s_Style = new ParentConstraintEditor.Styles();
     }
     base.serializedObject.Update();
     base.ShowConstraintEditor <ParentConstraint>(ParentConstraintEditor.s_Style);
     base.serializedObject.ApplyModifiedProperties();
 }