예제 #1
0
        protected void OnDisable()
        {
            if (quitting)
            {
                return;
            }

            if (looped || stopOnDestroy)
            {
                if (instance != null)
                {
                    instance.Stop();
                }

                if (audioSource != null)
                {
                    SoundManager.StopPooledClip(audioSource);
                }
            }
        }
예제 #2
0
        public void OnDestroy()
        {
            if (isQuitting)
            {
                return;
            }

            if (instance != null)
            {
                instance.Stop();
            }
        }
예제 #3
0
        private void FadeOutCurrentChild(float time)
        {
            if (currentChild == null)
            {
                return;
            }

            //Swap children
            ArdenAudioInstance oChild = fadingOutChild;

            fadingOutChild = currentChild;
            currentChild   = oChild;

            //If we've already been fading something out, then just force stop it
            if (currentChild != null)
            {
                currentChild.Stop();
                currentChild = null;
            }

            fadingOutChild.FadeOut(time);
        }
예제 #4
0
        public override void Stop()
        {
            if (completed)
            {
                return;
            }

            base.Stop();

            if (currentChild != null)
            {
                currentChild.Stop();
            }

            if (fadingOutChild != null)
            {
                fadingOutChild.Stop();
            }

            currentChild   = null;
            fadingOutChild = null;

            //Stop any coroutines as well
        }