public override void OnInspectorGUI() { DrawDefaultInspector(); VacuumSound script = (VacuumSound)target; if (GUILayout.Button("Start Engine")) { if (Application.isPlaying) { script.StartEngine(); } } if (GUILayout.Button("Stop Engine")) { if (Application.isPlaying) { script.StopEngine(); } } if (GUI.changed) { EditorUtility.SetDirty(vacuumSound); } serializedVacuumSound.ApplyModifiedProperties(); }
private void UpdateDustSuckerStatus(bool status) { dustSuckerActive = status; if (dustSuckerActive) { sound.StartEngine(); } else { sound.StopEngine(); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); VacuumSound script = (VacuumSound)target; if (GUILayout.Button("Start Engine")) { script.StartEngine(); } if (GUILayout.Button("Stop Engine")) { script.StopEngine(); } }