Example #1
0
        public static AudioHandler PlaySound(AudioData ads)
        {
            AudioHandler handler = InstantiateAudioObject();

            handler.AddQueue(ads);
            handler.Play();
            return(handler);
        }
Example #2
0
        /// <summary>
        /// 在指定位置播放音效
        /// </summary>
        /// <param name="att">声音属性设置</param>
        /// <param name="pos">坐标</param>
        public static AudioHandler PlaySoundAtLocation(AudioData ads, Vector3 pos)
        {
            AudioHandler handler = InstantiateAudioObject(pos);

            handler.AddQueue(ads);
            //  Debug.Log(ads);
            handler.Play();
            return(handler);
        }
Example #3
0
        /// <summary>
        /// 在指定位置播放音效
        /// </summary>
        /// <param name="att">声音属性设置</param>
        /// <param name="pos">坐标</param>
        public static AudioHandler PlaySoundAtLocation(AudioAttribute att, Vector3 pos)
        {
            TagHandle(att);
            AudioHandler handler = InstantiateAudioObject(pos);

            AudioEventHandle(att, handler);
            handler.AddQueue(att);
            handler.Play();
            return(handler);
        }
Example #4
0
        /// <summary>
        /// 附加BGM到摄像头
        /// </summary>
        /// <param name="att"></param>
        public static AudioHandler AttackBGMtoCamera(AudioAttribute att)
        {
            att      = TagHandle(att);
            att.loop = true;
            AudioHandler handler = Camera.main.gameObject.AddComponent <AudioHandler>();

            AudioEventHandle(att, handler);
            handler.AddQueue(att);
            handler.Play();
            return(handler);
        }