Beeg checkin
This commit is contained in:
17
Audio/Scripts/BGMPlayer.cs
Normal file
17
Audio/Scripts/BGMPlayer.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user