コード例 #1
0
        AudioPoolObject Play(string name, AudioClip clip, bool isLoop, float volumne = 1.0f)
        {
            AudioPoolObject temp = (AudioPoolObject)PoolManager.GetFromPool(clip.name);

            if (temp == null)
            {
                GameObject obj = new GameObject();
                temp = obj.GetOrAddComponent <AudioPoolObject>();
                PoolManager.SavePoolGameObject(clip.name, temp);
                temp.DontDestory();
            }
            temp.Show();
            temp.Clip    = clip;
            temp.IsLoop  = isLoop;
            temp.Volumne = volumne;
            return(temp);
        }
コード例 #2
0
        /// <summary>
        /// ±³¾°ÒôÀÖ
        /// </summary>
        /// <param name="clipPath"></param>
        public static AudioPoolObject PlayBG(string clipPath, bool isLoop = true, float volumne = 1.0f)
        {
            AudioClip       clip = Resources.Load <AudioClip>(Config.AudioPath + clipPath);
            AudioPoolObject temp = (AudioPoolObject)PoolManager.GetFromPool("BGMusic");

            if (temp == null)
            {
                GameObject obj = new GameObject();
                temp = obj.GetOrAddComponent <AudioPoolObject>();
                PoolManager.SavePoolGameObject("BGMusic", temp);
                temp.DontDestory();
            }
            temp.Clip    = clip;
            temp.IsLoop  = isLoop;
            temp.Volumne = volumne;
            return(temp);
        }
コード例 #3
0
        /// <summary>
        /// ±³¾°ÒôÀÖ
        /// </summary>
        /// <param name="clipPath"></param>
        public static AudioPoolObject PlayBG(string clipPath, bool isLoop = true, float volumne = 1.0f)
        {
            AudioClip clip     = null;
            string    clipName = GetClipName(clipPath);

            Instance.AudioClipDictionary.TryGetValue(clipName, out clip);
            if (clip == null)
            {
                Resources.Load <AudioClip>(Config.AudioPath + clipPath);
            }

            AudioPoolObject temp = Play("BGMusic", clip, isLoop, volumne);

            temp.DontDestory();
            temp.Play();
            return(temp);
        }
コード例 #4
0
        /// <summary>
        /// ±³¾°ÒôÀÖ
        /// </summary>
        /// <param name="clipPath"></param>
        public static AudioPoolObject PlayBG(string clipPath, string clipName, bool isLoop = true, float volumne = 1.0f)
        {
            AudioClip clip = null;

            Instance.AudioClipDictionary.TryGetValue(clipName, out clip);
            if (clip == null)
            {
                Resources.Load <AudioClip>(Config.AudioPath + clipPath + "/" + clipName);
            }
            int             begin = clipPath.LastIndexOf("/");
            string          name  = clipPath.Substring();
            AudioPoolObject temp  = Play("BGMusic", clip, isLoop, volumne);

            temp.DontDestory();
            temp.Play();
            return(temp);
        }
コード例 #5
0
        /// <summary>
        /// ±³¾°ÒôÀÖ
        /// </summary>
        /// <param name="clipPath"></param>
        public static void PlayBG(string clipPath, bool isLoop = true, float volumne = 1.0f)
        {
            AudioClip       clip = Resources.Load <AudioClip>(Config.AudioPath + clipPath);
            AudioPoolObject temp = (AudioPoolObject)PoolManager.GetFromPool(clip.name);

            if ()
            {
            }


            GameObject      obj  = new GameObject();
            AudioPoolObject temp = obj.GetOrAddComponent <AudioPoolObject>();

            temp.IsLoop  = isLoop;
            temp.Volumne = volumne;
            temp.Clip    = clip;
            temp.DontDestory();
        }
コード例 #6
0
 public static AudioPoolObject Play(string clipPath, bool isLoop = false, float volumne = 1.0f)
 {
     AudioClip       clip = Resources.Load <AudioClip>(Config.AudioPath + clipPath);
     AudioPoolObject temp =
         return(Play(clip.name, clip, isLoop, volumne));
 }
コード例 #7
0
 public static AudioPoolObject PlayDelay(string clipPath, bool isLoop = false,float volumne = 1.0f, float delay = 0.1f){
     AudioClip clip = Resources.Load<AudioClip>(Config.AudioPath + clipPath);
     AudioPoolObject temp = Play(clip.name, clip, isLoop, volumne);
     temp.PlayOnDelay(delay);
     return temp;
 }
コード例 #8
0
 public static AudioPoolObject PlayMusic(string clipPath, bool isLoop = false, float volumne = 1.0f)
 {
     AudioClip       clip = Resources.Load <AudioClip>(Config.AudioPath + clipPath);
     AudioPoolObject temp = (AudioPoolObject)PoolManager.GetFromPool(clip.name);
 }
コード例 #9
0
 /// <summary>
 /// ±³¾°ÒôÀÖ
 /// </summary>
 /// <param name="clipPath"></param>
 public static void PlayBG(string clipPath, bool isLoop = true, float volumn = 1.0f)
 {
     AudioClip       clip = Resources.Load <AudioClip>(Config.AudioPath + clipPath);
     GameObject      obj  = new GameObject();
     AudioPoolObject temp = obj.GetOrAddComponent <AudioPoolObject>();
 }