StopClip() private méthode

private StopClip ( AudioClip clip ) : void
clip UnityEngine.AudioClip
Résultat void
        protected override void OnDisable()
        {
            base.OnDisable();
            MovieTexture movieTexture = this.target as MovieTexture;

            if (!Application.isPlaying && movieTexture != null)
            {
                AudioClip audioClip = movieTexture.audioClip;
                movieTexture.Stop();
                if (audioClip != null)
                {
                    AudioUtil.StopClip(audioClip);
                }
            }
        }
        protected override void OnDisable()
        {
            base.OnDisable();
            MovieTexture target = base.target as MovieTexture;

            if (!Application.isPlaying && (target != null))
            {
                AudioClip audioClip = target.audioClip;
                target.Stop();
                if (audioClip != null)
                {
                    AudioUtil.StopClip(audioClip);
                }
            }
        }
Exemple #3
0
        protected override void OnDisable()
        {
            base.OnDisable();
            MovieTexture t = target as MovieTexture;

            //stop movies we started.
            if (!Application.isPlaying && t != null)
            {
                AudioClip ac = t.audioClip;
                t.Stop();
                if (ac != null)
                {
                    AudioUtil.StopClip(ac);
                }
            }
        }
        public override void OnPreviewSettings()
        {
            if (s_DefaultIcon == null)
            {
                Init();
            }

            AudioClip clip = target as AudioClip;

            m_MultiEditing = targets.Length > 1;

            {
                using (new EditorGUI.DisabledScope(m_MultiEditing))
                {
                    s_AutoPlay = s_AutoPlay && !m_MultiEditing;
                    s_AutoPlay = PreviewGUI.CycleButton(s_AutoPlay ? 1 : 0, s_AutoPlayIcons) != 0;
                }

                bool loop = s_Loop;
                s_Loop = PreviewGUI.CycleButton(s_Loop ? 1 : 0, s_LoopIcons) != 0;
                if ((loop != s_Loop) && playing)
                {
                    AudioUtil.LoopClip(clip, s_Loop);
                }

                using (new EditorGUI.DisabledScope(m_MultiEditing && !playing))
                {
                    bool newPlaying = PreviewGUI.CycleButton(playing ? 1 : 0, s_PlayIcons) != 0;

                    if (newPlaying != playing)
                    {
                        if (newPlaying)
                        {
                            PlayClip(clip, 0, s_Loop);
                        }
                        else
                        {
                            AudioUtil.StopClip(m_Clip);
                            m_Clip            = null;
                            s_PlayingInstance = null;
                        }
                    }
                }
            }
        }
        protected override void OnDisable()
        {
            base.OnDisable();
            MovieTexture target = this.target as MovieTexture;

            if (Application.isPlaying || !((Object)target != (Object)null))
            {
                return;
            }
            AudioClip audioClip = target.audioClip;

            target.Stop();
            if (!((Object)audioClip != (Object)null))
            {
                return;
            }
            AudioUtil.StopClip(audioClip);
        }