Setup and play area prefab

This commit is contained in:
Max 2025-03-19 09:23:22 +01:00
parent fe61df43e7
commit af12b601fc
166 changed files with 14014 additions and 10 deletions

View file

@ -0,0 +1,26 @@
using System;
using System.Linq;
namespace DefaultNamespace
{
[System.Serializable]
public class SoundGroup
{
public string name;
public Sound[] sounds;
private int index;
public void Play()
{
if (index >= sounds.Length)
{
// Shuffle the sounds
sounds = sounds.OrderBy(s => Guid.NewGuid()).ToArray();
index = 0;
}
sounds[index].source.Play();
index++;
}
}
}