示例#1
0
 private void Start()
 {
     audioSources = new AudioSource[ids.Length];
     for (int i = 0; i < ids.Length; i++)
     {
         var source = new GameObject().AddComponent <AudioSource>();
         source.clip         = Res.ResourceLoader.instance.LoadedAudio[ids[i]];
         source.spatialBlend = 0;
         source.rolloffMode  = AudioRolloffMode.Linear;
         source.maxDistance  = 1999999;
         audioSources[i]     = source;
         source.gameObject.SetActive(false);
     }
     instance = this;
 }
示例#2
0
        private void Start()
        {
            int[] ids = Enumerable.Range(1070, 18).Concat(
                new int[] { 1002, 1003, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1016, 1005 }).ToArray();

            audioSources = new AudioSource[ids.Length];
            for (int i = 0; i < ids.Length; i++)
            {
                var source = new GameObject().AddComponent <AudioSource>();
                source.clip         = Res.ResourceLoader.instance.LoadedAudio[ids[i]];
                source.spatialBlend = 1f;
                source.rolloffMode  = AudioRolloffMode.Linear;
                source.maxDistance  = 1999999;
                audioSources[i]     = source;
                source.gameObject.SetActive(false);
            }
            instance = this;
        }