public override void OnInspectorGUI() { serializedObject.Update(); aiScript = (SAICSmartAICar)target; if(GUILayout.Button("Create Wheel Colliders")){ WheelCollider[] wheelColliders = aiScript.gameObject.GetComponentsInChildren<WheelCollider>(); if(wheelColliders.Length >= 1) Debug.LogError("Your Vehicle has Wheel Colliders already!"); else aiScript.CreateWheelColliders(); } DrawDefaultInspector(); if(GUI.changed && !EditorApplication.isPlaying){ EngineCurveInit(); } serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); aiScript = (SAICSmartAICar)target; if (GUILayout.Button("Create Wheel Colliders")) { WheelCollider[] wheelColliders = aiScript.gameObject.GetComponentsInChildren <WheelCollider>(); if (wheelColliders.Length >= 1) { Debug.LogError("Your Vehicle has Wheel Colliders already!"); } else { aiScript.CreateWheelColliders(); } } DrawDefaultInspector(); if (GUI.changed && !EditorApplication.isPlaying) { EngineCurveInit(); } serializedObject.ApplyModifiedProperties(); }
void Start() { wheelCollider = GetComponent<WheelCollider>(); carController = transform.root.GetComponent<SAICSmartAICar>(); carRigid = carController.GetComponent<Rigidbody>(); if(FindObjectOfType(typeof(SAICSkidmarks))) skidmarks = FindObjectOfType(typeof(SAICSkidmarks)) as SAICSkidmarks; else Debug.Log("No skidmarks object found. Skidmarks will not be drawn. Drag ''RCCSkidmarksManager'' from Prefabs folder, and drop on to your existing scene..."); }
void Start() { wheelCollider = GetComponent <WheelCollider>(); carController = transform.root.GetComponent <SAICSmartAICar>(); carRigid = carController.GetComponent <Rigidbody>(); if (FindObjectOfType(typeof(SAICSkidmarks))) { skidmarks = FindObjectOfType(typeof(SAICSkidmarks)) as SAICSkidmarks; } else { Debug.Log("No skidmarks object found. Skidmarks will not be drawn. Drag ''RCCSkidmarksManager'' from Prefabs folder, and drop on to your existing scene..."); } }
void Awake() { aiScript = (SAICSmartAICar)target; }