Beispiel #1
0
 void OnDisable()
 {
     if (isAutoPlay)
     {
         targetScript.Stop();
     }
 }
Beispiel #2
0
        public void Stop()
        {
            if (loopCoroutine != null)
            {
                isLooping = false;
                StopCoroutine(loopCoroutine);
                loopCoroutine = null;
            }

            if (currentCoroutine != null)
            {
                StopCoroutine(currentCoroutine);
                currentCoroutine = null;
            }

            if (clip == null)
            {
                return;
            }

            clip.Stop();
        }