Esempio n. 1
0
    void OnTriggerEnter(Collider collider)
    {
        Debug.Log("OnTriggerEnter");
        //activate effect
        NAReverbEffector e = collider.gameObject.GetComponent <NAReverbEffector> ();

        if (e)
        {
            e.AddResonator(this);
        }
    }
Esempio n. 2
0
    void OnTriggerExit(Collider collider)
    {
        Debug.Log("OnTriggerExit");
        //unactivate effect
        NAReverbEffector e = collider.gameObject.GetComponent <NAReverbEffector> ();

        if (e)
        {
            e.RemoveResonator(this);
        }
    }
Esempio n. 3
0
    //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>();
         * }
         */
        //
    }
Esempio n. 4
0
    //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);
            }
        }
    }