void DoAdvanvedView(Type canvasType, bool includeSimple) { SerializedProperty mainDivisions = serializedObject.FindProperty("mainDivisions"); SerializedProperty subDivisions = serializedObject.FindProperty("subDivisions"); mMain = mainDivisions.isExpanded = EditorGUILayout.Foldout(mainDivisions.isExpanded, "Main Divisions"); if (mMain) { EditorGUI.indentLevel++; SerializedProperty end = mainDivisions.GetEndProperty(); while (mainDivisions.NextVisible(true) && SerializedProperty.EqualContents(mainDivisions, end) == false) { if (ChartEditorCommon.HasAttributeOfType(typeof(ChartDivisionInfo), mainDivisions.name, canvasType) == false) { if (ChartEditorCommon.HasAttributeOfType(typeof(AxisBase), mainDivisions.name, canvasType) == false) { continue; } } if (includeSimple == false) { if (ChartEditorCommon.HasAttributeOfType(typeof(ChartDivisionInfo), mainDivisions.name, typeof(SimpleAttribute))) { continue; } } EditorGUILayout.PropertyField(mainDivisions); } EditorGUI.indentLevel--; } mSub = subDivisions.isExpanded = EditorGUILayout.Foldout(subDivisions.isExpanded, "Sub Divisions"); if (mSub) { EditorGUI.indentLevel++; SerializedProperty end = subDivisions.GetEndProperty(); while (subDivisions.NextVisible(true) && SerializedProperty.EqualContents(subDivisions, end) == false) { if (ChartEditorCommon.HasAttributeOfType(typeof(ChartDivisionInfo), subDivisions.name, canvasType) == false) { if (ChartEditorCommon.HasAttributeOfType(typeof(AxisBase), subDivisions.name, canvasType) == false) { continue; } } if (includeSimple == false) { if (ChartEditorCommon.HasAttributeOfType(typeof(ChartDivisionInfo), subDivisions.name, typeof(SimpleAttribute))) { continue; } } EditorGUILayout.PropertyField(subDivisions); } EditorGUI.indentLevel--; } }
void DoSimpleView(Type canvasType) { SerializedProperty it = serializedObject.FindProperty("mainDivisions"); SerializedProperty SubDivisions = serializedObject.FindProperty("subDivisions"); object mainDivision = ((AxisBase)target).MainDivisions; object subDivision = ((AxisBase)target).SubDivisions; if (it == null || SubDivisions == null) { return; } SerializedProperty end = it.GetEndProperty(); while (it.NextVisible(true) && SerializedProperty.EqualContents(end, it) == false) { if (it.name == "SimpleView") { continue; } if (ChartEditorCommon.HasAttributeOfType(typeof(ChartDivisionInfo), it.name, canvasType) == false) { if (ChartEditorCommon.HasAttributeOfType(typeof(AxisBase), it.name, canvasType) == false) { continue; } } if (ChartEditorCommon.HasAttributeOfType(typeof(AxisBase), it.name, typeof(SimpleAttribute)) == false) { if (ChartEditorCommon.HasAttributeOfType(typeof(ChartDivisionInfo), it.name, typeof(SimpleAttribute)) == false) { continue; } } SerializedProperty clone = SubDivisions.FindPropertyRelative(it.name); if (clone == null) { Debug.LogWarning("can't find property " + it.name); } bool equal = CompareValues(typeof(ChartDivisionInfo), clone.name, mainDivision, subDivision); Type t = getTypeFromField(typeof(ChartDivisionInfo), clone.name); EditorGUI.BeginChangeCheck(); EditorGUI.showMixedValue = !equal; DoMixedFiled(it, t); EditorGUI.showMixedValue = false; if (EditorGUI.EndChangeCheck()) { SetValue(clone, it); } } DoAdvanvedView(canvasType, false); }