void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { SoundGameEvent.OnHearSoundMethod(soundIntensity); if (!alarm.isPlaying) { alarm.Play(); } } }
void makeSound() { if (!SerialComReader.isInSerial) { if (Input.GetButtonDown("Fire2") && !knockSound.isPlaying) { SoundGameEvent.OnHearSoundMethod(soundIntensity); //knockSound.Play (); } } else { if (SERIAL_ARDUINO_.SerialCom.previousData [1] > threshold) { SoundGameEvent.OnHearSoundMethod((float)SERIAL_ARDUINO_.SerialCom.previousData [1]); //knockSound.Play (); } } }