コード例 #1
0
ファイル: SoundStreamFade.cs プロジェクト: chaosrx/Utage_test
        void Update()
        {
            if (null != current)
            {
                current.Update();
            }

            if (null != next)
            {
                if (next.IsReady() && current == null)
                {
                    current = next;
                    current.Play();
                    next = null;
                }
            }
        }
コード例 #2
0
        void Update()
        {
            if (null != last)
            {
                last.Update();
            }
            if (null != current)
            {
                current.Update();
            }

            if (null != current)
            {
                if (current.IsReady() && last == null)
                {
                    current.Play();
                }
            }
        }
コード例 #3
0
		internal SoundStream Play(AudioClip clip, float fadeTime, float volume, bool isLoop, bool isStreaming, Func<float> callbackMasterVolume, Action callbackEnd)
		{
			if (null != last) GameObject.Destroy(last.gameObject);
			
			if (null == current)
			{
				current = UtageToolKit.AddChildGameObjectComponent<SoundStream>(this.transform, clip.name);
				//即時再生
				current.Play(clip, volume, isLoop, isStreaming, callbackMasterVolume, callbackEnd);
				return current;
			}
			else
			{
				//フェードアウト後に再生
				last = current;
				last.FadeOut(fadeTime);
				current = UtageToolKit.AddChildGameObjectComponent<SoundStream>(this.transform, clip.name);
				current.Ready(clip, volume, isLoop, isStreaming, callbackMasterVolume, callbackEnd);
				return current;
			}
		}
コード例 #4
0
ファイル: SoundStreamFade.cs プロジェクト: chaosrx/Utage_test
        internal SoundStream Play(AudioClip clip, float fadeTime, float masterVolume, float volume, bool isLoop, bool isStreaming, Action callBackEnd)
        {
            if (null != next)
            {
                GameObject.Destroy(next.gameObject);
            }

            if (null == current)
            {
                current = UtageToolKit.AddChildGameObjectComponent <SoundStream>(this.transform, clip.name);
                //即時再生
                current.Play(clip, masterVolume, volume, isLoop, isStreaming, callBackEnd);
                return(current);
            }
            else
            {
                //フェードアウト後に再生
                current.FadeOut(fadeTime);
                next = UtageToolKit.AddChildGameObjectComponent <SoundStream>(this.transform, clip.name);
                next.Ready(clip, masterVolume, volume, isLoop, isStreaming, callBackEnd);
                return(next);
            }
        }