private void Play() { audioSource.Play(); SoundMechanicHandler.PlaySound(transform, transform.position, repetitionLoudness, repetitionRange, true); light.enabled = true; Invoke("DisableLight", 1); }
private void OnTriggerEnter(Collider other) { if (other.tag == "Untagged" && Time.timeSinceLevelLoad - timeStamp > cooldown) { timeStamp = Time.timeSinceLevelLoad; SoundMechanicHandler.PlaySound(transform, transform.position, Loudness, Range, false); source.volume = Loudness / 10; source.Play(); } }