public override void OnInspectorGUI() { var myTarget = (InfiniteWheelController)target; if (myTarget.premadeWheelConfig) { if (EditorCurve.IsCurveConfigSettingIncorrect(myTarget.premadeWheelConfig, false)) { string name_var = NameOf.nameof(() => myTarget.premadeWheelConfig); EditorGUILayout.HelpBox("The variable (" + name_var + ") contains incorrect settings.", MessageType.Warning); EditorCurve.IsCurveConfigSettingIncorrect(myTarget.premadeWheelConfig, true); } } DrawDefaultInspector(); }
public static bool IsCurveConfigSettingIncorrect(CurveConfig curveConfig, bool show_warning) { bool incorrect = false; if (IsCurveIncorrect(NameOf.nameof(() => curveConfig.position_x), curveConfig.position_x, show_warning)) { incorrect = true; } if (IsCurveIncorrect(NameOf.nameof(() => curveConfig.position_y), curveConfig.position_y, show_warning)) { incorrect = true; } if (IsCurveIncorrect(NameOf.nameof(() => curveConfig.position_z), curveConfig.position_z, show_warning)) { incorrect = true; } if (IsCurveIncorrect(NameOf.nameof(() => curveConfig.rotation_x), curveConfig.rotation_x, show_warning)) { incorrect = true; } if (IsCurveIncorrect(NameOf.nameof(() => curveConfig.rotation_y), curveConfig.rotation_y, show_warning)) { incorrect = true; } if (IsCurveIncorrect(NameOf.nameof(() => curveConfig.rotation_z), curveConfig.rotation_z, show_warning)) { incorrect = true; } if (IsCurveIncorrect(NameOf.nameof(() => curveConfig.itemScale), curveConfig.itemScale, show_warning)) { incorrect = true; } if (IsCurveIncorrect(NameOf.nameof(() => curveConfig.colliderActivate), curveConfig.colliderActivate, show_warning)) { incorrect = true; } if (IsCurveIncorrect(NameOf.nameof(() => curveConfig.itemActivate), curveConfig.itemActivate, show_warning)) { incorrect = true; } return(incorrect); }