We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 711c3ab commit 354c33cCopy full SHA for 354c33c
1 file changed
Assets/Scripts/Animations/AnimSequence.cs
@@ -2,9 +2,6 @@
2
using System.Collections.Generic;
3
using UnityEngine.Events;
4
using UnityEngine;
5
-using UnityEditor;
6
-using UnityEditor.UIElements;
7
-using UnityEngine.UIElements;
8
9
namespace Veridium_Animation{
10
public class AnimSequence : MonoBehaviour
@@ -178,7 +175,7 @@ private void UpdateAnimations(){
178
175
anim.Pause();
179
176
anim.End();
180
177
playingAnims.Remove(anim);
181
-
+
182
}
183
184
@@ -303,6 +300,11 @@ public void PlayNextSegment(){
303
300
304
301
305
302
currentIndex ++;
+ if (currentIndex >= segments.Count) {
+ playing = false;
+ return;
306
+ }
307
308
audioSource.clip = segments[currentIndex].GetAudioClip();
309
audioSource.Play();
310
audioHasFinished = false;
0 commit comments