public new void DrawDefaultInspector() { NodePropertyIterator iterator = this.serializedNode.GetIterator(); int indentLevel = EditorGUI.indentLevel; while (iterator.Next(iterator.current == null || (iterator.current.propertyType != NodePropertyType.Variable && !iterator.current.hideInInspector))) { SerializedNodeProperty current = iterator.current; if (!current.hideInInspector) { if (current.path == "motionOverride" && mecanimNode != null && mecanimNode.animatorStateSelected != null && mecanimNode.animatorStateSelected.motion != null && mecanimNode.animatorStateSelected.motion is BlendTree) { continue; } if (current.path == "blendX" && mecanimNode != null && mecanimNode.animatorStateSelected != null && (mecanimNode.animatorStateSelected.motion == null || !(mecanimNode.animatorStateSelected.motion is BlendTree && !String.IsNullOrEmpty(((BlendTree)mecanimNode.animatorStateSelected.motion).blendParameter)) )) { continue; } if (current.path == "blendY" && mecanimNode != null && mecanimNode.animatorStateSelected != null && (mecanimNode.animatorStateSelected.motion == null || !(mecanimNode.animatorStateSelected.motion is BlendTree && !String.IsNullOrEmpty(((BlendTree)mecanimNode.animatorStateSelected.motion).blendParameterY)) )) { continue; } EditorGUI.indentLevel = indentLevel + iterator.depth; GUILayoutHelper.DrawNodeProperty(new GUIContent(current.label, current.tooltip), current, mecanimNode, null, true); } } EditorGUI.indentLevel = indentLevel; this.serializedNode.ApplyModifiedProperties(); }
/// <summary> /// The custom inspector. /// </summary> public override void OnInspectorGUI() { //why is this line for??? // if (Event.current.type == EventType.Layout) { // this.serializedNode.Update (); // // } bool isAnalogInput = false; bool isFullAxis = false; NodePropertyIterator iterator = this.serializedNode.GetIterator(); if (iterator.Find("inputType")) { isAnalogInput = (GetInputNode.InputType)iterator.current.value == GetInputNode.InputType.GetInput; } if (isAnalogInput && iterator.Find("fullAxis")) { isFullAxis = (bool)iterator.current.value; } iterator = this.serializedNode.GetIterator(); int indentLevel = EditorGUI.indentLevel; while (iterator.Next(iterator.current == null || (iterator.current.propertyType != NodePropertyType.Variable && !iterator.current.hideInInspector))) { SerializedNodeProperty current = iterator.current; if (!current.hideInInspector) { if (!isAnalogInput) { if ( current.path == "sensitivity" || current.path == "dreadzone" || current.path == "gravity" || current.path == "multiplier" || current.path == "variable" || current.path == "fullAxis" || current.path == "inputStateNeg" ) { continue; } } else if (!isFullAxis && current.path == "inputStateNeg") { continue; } EditorGUI.indentLevel = indentLevel + iterator.depth; GUILayoutHelper.DrawNodeProperty(new GUIContent(current.label, current.tooltip), current, this.target, null, true); } } EditorGUI.indentLevel = indentLevel; this.serializedNode.ApplyModifiedProperties(); }