public WheelController(Transform transform, WheelAxisCorrection correction) { _wheelCollider = transform.GetComponent <WheelCollider>(); _transform = transform.GetChild(0); _attachedRigidbody = _wheelCollider.attachedRigidbody; _correction = correction; }
public override void OnInspectorGUI() { _headerStyle ??= new GUIStyle(EditorStyles.boldLabel) { fontSize = 16 }; EditorGUILayout.LabelField("Editor region", _headerStyle); EditorGUILayout.Separator(); bool setupWheels = GUILayout.Button("Setup wheels"); _correction = (WheelAxisCorrection)EditorGUILayout.EnumPopup("Wheel correction:", _correction); EditorGUILayout.Separator(); EditorGUILayout.LabelField("Script region", _headerStyle); EditorGUILayout.Separator(); base.OnInspectorGUI(); if (setupWheels) { SetupWheels(); } }