示例#1
0
    // Use this for initialization
    void Start()
    {
        //Find dynamic music object
        music    = GameObject.FindGameObjectWithTag("Music").GetComponent <DynamicMusic>();
        volume2D = music.GetVolume(false);
        volume3D = music.GetVolume(true);

        //List of audio sources in relevant speakers
        sources = new List <AudioSource>();
        foreach (GameObject s in speakersOn)
        {
            sources.Add(s.GetComponent <AudioSource>());
        }
    }