void OnTriggerEnter(Collider collider) { Debug.Log("OnTriggerEnter"); //activate effect NAReverbEffector e = collider.gameObject.GetComponent <NAReverbEffector> (); if (e) { e.AddResonator(this); } }
void OnTriggerExit(Collider collider) { Debug.Log("OnTriggerExit"); //unactivate effect NAReverbEffector e = collider.gameObject.GetComponent <NAReverbEffector> (); if (e) { e.RemoveResonator(this); } }
//public static bool bDisplayAudioSourceName = true; public static void DecorateAudioSource(AudioSource s) { NAReverbEffector eff = s.gameObject.GetComponent <NAReverbEffector>(); if (eff == null) { s.gameObject.AddComponent <NAReverbEffector>(); } AudioReverbFilter arf = s.gameObject.GetComponent <AudioReverbFilter>(); if (arf == null) { s.gameObject.AddComponent <AudioReverbFilter>(); } NAAudioSource src = s.gameObject.GetComponent <NAAudioSource>(); if (src == null) { s.gameObject.AddComponent <NAAudioSource>(); } if (NA.bAugmentAudioSources) { NAOcclusionFX occ = s.gameObject.GetComponent <NAOcclusionFX>(); if (occ == null) { s.gameObject.AddComponent <NAOcclusionFX>(); //workaround NAOcclusionFX occ2 = s.gameObject.AddComponent <NAOcclusionFX>(); NAOcclusionFX.Destroy(occ2); } } /*if (Network.isServer) * { * NATogglePlayOnCollide poc = s.gameObject.AddComponent<NATogglePlayOnCollide>(); * } */ // }
//public static bool bDisplayAudioSourceName = true; public static void DecorateAudioSource(AudioSource s) { NAReverbEffector eff = s.gameObject.GetComponent <NAReverbEffector>(); if (eff == null) { s.gameObject.AddComponent <NAReverbEffector>(); } AudioReverbFilter arf = s.gameObject.GetComponent <AudioReverbFilter>(); if (arf == null) { s.gameObject.AddComponent <AudioReverbFilter>(); } NAAudioSource src = s.gameObject.GetComponent <NAAudioSource>(); if (src == null) { s.gameObject.AddComponent <NAAudioSource>(); } if (NA.bAugmentAudioSources) { NAOcclusionFX occ = s.gameObject.GetComponent <NAOcclusionFX>(); if (occ == null) { s.gameObject.AddComponent <NAOcclusionFX>(); //workaround NAOcclusionFX occ2 = s.gameObject.AddComponent <NAOcclusionFX>(); NAOcclusionFX.Destroy(occ2); } } }