Skip to content

Commit 354c33c

Browse files
committed
fix array acess errors
1 parent 711c3ab commit 354c33c

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Assets/Scripts/Animations/AnimSequence.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
using System.Collections.Generic;
33
using UnityEngine.Events;
44
using UnityEngine;
5-
using UnityEditor;
6-
using UnityEditor.UIElements;
7-
using UnityEngine.UIElements;
85

96
namespace Veridium_Animation{
107
public class AnimSequence : MonoBehaviour
@@ -178,7 +175,7 @@ private void UpdateAnimations(){
178175
anim.Pause();
179176
anim.End();
180177
playingAnims.Remove(anim);
181-
178+
182179
}
183180

184181
}
@@ -303,6 +300,11 @@ public void PlayNextSegment(){
303300
}
304301

305302
currentIndex ++;
303+
if (currentIndex >= segments.Count) {
304+
playing = false;
305+
return;
306+
}
307+
306308
audioSource.clip = segments[currentIndex].GetAudioClip();
307309
audioSource.Play();
308310
audioHasFinished = false;

0 commit comments

Comments
 (0)