Esempio n. 1
0
        private void StopClip()
        {
            if (CurrentlyPlayingCoroutine != null)
            {
                RuntimeHelper.StopCoroutine(CurrentlyPlayingCoroutine);
            }

            Source.Stop();
            CurrentlyPlaying               = null;
            CurrentlyPlayingCoroutine      = null;
            playStopButton.ButtonText.text = "Play Clip";

            ResetProgressLabel();
        }
Esempio n. 2
0
        private IEnumerator PlayClipCoroutine()
        {
            playStopButton.ButtonText.text = "Stop Clip";
            CurrentlyPlaying = this;
            Source.clip      = this.RefAudioClip;
            Source.Play();

            while (Source.isPlaying)
            {
                progressLabel.text = $"{GetLengthString(Source.time)} / {fullLengthText}";
                yield return(null);
            }

            CurrentlyPlayingCoroutine = null;
            StopClip();
        }