public override void DrawInspectorGUI()
        {
            DrawProperty("centerOfMass");
            s_inertiaExpanded = DrawProperty("inertia").isExpanded;

            Space();
            if (CommonEditorTools.IsActiveAndPlaying((MonoBehaviour)target))
            {
                GUI.enabled = false;
            }
            DrawProperty("frontAxle");
            DrawProperty("rearAxle");
            Space();
            DrawProperty("frontTires");
            DrawProperty("rearTires");
            GUI.enabled = true;
            Space();
            DrawProperty("frontAxleReference");
            DrawProperty("rearAxleReference");

            DrawHeader("Powertrain and dynamics");

            DrawProperty("input");
            DrawProperty("frontMgu");
            DrawProperty("rearMgu");
            Space();
            DrawProperty("frontDifferential");
            DrawProperty("rearDifferential");
            Space();
            DrawProperty("steering");

            DrawHeader("Driving Aids");
            DrawProperty("steeringAids");
            DrawProperty("speedControl");

            DrawHeader("Safety Aids");
            DrawProperty("tractionControl", "Traction Control (TCS)");

            DrawHeader("Advanced");
            SetMinLabelWidth(165);
            DrawProperty("integrationSteps");
            DrawProperty("integrationUseRK4");
            DrawProperty("wheelSleepVelocity");
            DrawProperty("tireAdherentImpulseRatio");

            DrawHeader("Experimental");
            DrawProperty("tireSideDeflection");
            DrawProperty("tireSideDeflectionRate");

            Space();
            SetMinLabelWidth(190);
            bool advancedSuspension = DrawProperty("advancedSuspensionDamper").boolValue;

            if (!advancedSuspension)
            {
                GUI.enabled = false;
            }
            DrawProperty("suspensionDamperLimitFactor");
            GUI.enabled = true;
        }
示例#2
0
        public override void DrawInspectorGUI()
        {
            SetMinLabelWidth(180);
            DrawDefaultInspector();

            Space(10);
            EditorGUILayout.BeginHorizontal();
            Space(50);

            // Handle auto-regenerate

            s_autoRegenerate = GUILayout.Toggle(s_autoRegenerate, "Auto Generate");

            if (s_autoRegenerate && CommonEditorTools.GUIChanged())
            {
                (target as UI.Gauge).Regenerate();
            }

            // Handle Regenerate button.
            // Must be done separately as GUIChanged doesn't respond to Undo within GUI.enabled = false.

            if (s_autoRegenerate)
            {
                GUI.enabled = false;
            }

            if (GUILayout.Button("Generate Gauge"))
            {
                (target as UI.Gauge).Regenerate();
            }

            GUI.enabled = true;

            EditorGUILayout.EndHorizontal();
        }