Placeholder music

This commit is contained in:
2023-09-02 18:33:44 -07:00
parent 271b0ede0d
commit cff32e0fb9
5 changed files with 43 additions and 0 deletions

17
Scripts/BGMPlayer.cs Normal file
View File

@@ -0,0 +1,17 @@
using Godot;
public partial class BGMPlayer : AudioStreamPlayer
{
public void SetBGMFromFilepath(string path)
{
var audioStream = ResourceLoader.Load<AudioStream>(path);
if (Stream != audioStream)
Stream = audioStream;
}
public void PlayBGM()
{
if (!Playing)
Play();
}
}