|
@@ -89,6 +89,20 @@ namespace KairoEngine.SoundtrackSystem
|
|
|
PlayTrack(instance.playlist.soundtracks[instance.currentTrackIndex]);
|
|
|
}
|
|
|
|
|
|
+ public static void PlayTrack(string soundtrackName)
|
|
|
+ {
|
|
|
+ if(instance == null) return;
|
|
|
+ for (int i = 0; i < instance.playlist.soundtracks.Count; i++)
|
|
|
+ {
|
|
|
+ if(instance.playlist.soundtracks[i].name == soundtrackName)
|
|
|
+ {
|
|
|
+ PlayTrack(instance.playlist.soundtracks[i]);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Debug.LogWarning($"Could not find soundtrack \"{soundtrackName}\" in playlist", instance.gameObject);
|
|
|
+ }
|
|
|
+
|
|
|
public static void PlayTrack(Soundtrack soundtrack)
|
|
|
{
|
|
|
if(instance == null) return;
|