public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(m_Weight); EditorGUILayout.PropertyField(m_Root); EditorGUILayout.PropertyField(m_Mid); EditorGUILayout.PropertyField(m_Tip); m_SourceObjectsToggle.boolValue = EditorGUILayout.Foldout(m_SourceObjectsToggle.boolValue, k_SourceObjectsLabel); if (m_SourceObjectsToggle.boolValue) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(m_Target); EditorGUILayout.PropertyField(m_Hint); EditorGUI.indentLevel--; } m_SettingsToggle.boolValue = EditorGUILayout.Foldout(m_SettingsToggle.boolValue, k_SettingsLabel); if (m_SettingsToggle.boolValue) { EditorGUI.indentLevel++; MaintainOffsetHelper.DoDropdown(k_MaintainTargetOffsetLabel, m_MaintainTargetPositionOffset, m_MaintainTargetRotationOffset); EditorGUILayout.PropertyField(m_TargetPositionWeight); EditorGUILayout.PropertyField(m_TargetRotationWeight); EditorGUILayout.PropertyField(m_HintWeight); EditorGUI.indentLevel--; } serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(m_Weight); EditorGUILayout.PropertyField(m_ConstrainedObject); m_SourceObjectsToggle.boolValue = EditorGUILayout.Foldout(m_SourceObjectsToggle.boolValue, k_SourceObjectsLabel); if (m_SourceObjectsToggle.boolValue) { // Sync list with sourceObjects. m_ReorderableList.list = m_Constraint.data.sourceObjects; EditorGUI.indentLevel++; m_ReorderableList.DoLayoutList(); EditorGUI.indentLevel--; } m_SettingsToggle.boolValue = EditorGUILayout.Foldout(m_SettingsToggle.boolValue, k_SettingsLabel); if (m_SettingsToggle.boolValue) { EditorGUI.indentLevel++; MaintainOffsetHelper.DoDropdown(k_MaintainOffsetLabel, m_MaintainPositionOffset, m_MaintainRotationOffset); EditorGUILayout.PropertyField(m_ConstrainedPositionAxes); EditorGUILayout.PropertyField(m_ConstrainedRotationAxes); EditorGUI.indentLevel--; } serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(m_Weight); EditorGUILayout.PropertyField(m_ConstrainedObject); m_SourceObjectsToggle.boolValue = EditorGUILayout.Foldout(m_SourceObjectsToggle.boolValue, k_SourceObjectsLabel); if (m_SourceObjectsToggle.boolValue) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(m_SourceA); EditorGUILayout.PropertyField(m_SourceB); EditorGUI.indentLevel--; } m_SettingsToggle.boolValue = EditorGUILayout.Foldout(m_SettingsToggle.boolValue, k_SettingsLabel); if (m_SettingsToggle.boolValue) { EditorGUI.indentLevel++; MaintainOffsetHelper.DoDropdown(k_MaintainOffset, m_MaintainPositionOffsets, m_MaintainRotationOffsets); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(m_BlendPosition, k_BlendPosLabel); using (new EditorGUI.DisabledScope(!m_BlendPosition.boolValue)) EditorGUILayout.PropertyField(m_PositionWeight, GUIContent.none); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PropertyField(m_BlendRotation, k_BlendRotLabel); using (new EditorGUI.DisabledScope(!m_BlendRotation.boolValue)) EditorGUILayout.PropertyField(m_RotationWeight, GUIContent.none); EditorGUILayout.EndHorizontal(); EditorGUI.indentLevel--; } serializedObject.ApplyModifiedProperties(); }