-
Notifications
You must be signed in to change notification settings - Fork 0
/
SoundPlayer.cs
48 lines (43 loc) · 1.14 KB
/
SoundPlayer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using Godot;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Bandit
{
public class SoundPlayer
{
private AudioStreamPlayer _StreamPlayer;
public AudioStream ProcessSound;
public AudioStream LeverSound;
public AudioStream WinnerSound;
public SoundPlayer(AudioStream process, AudioStream lever, AudioStream winner)
{
ProcessSound = process;
LeverSound = lever;
WinnerSound = winner;
_StreamPlayer = new AudioStreamPlayer();
Main.Base.AddChild(_StreamPlayer);
}
public void ProcessPlay()
{
_StreamPlayer.Stream = ProcessSound;
_StreamPlayer.Play();
}
public void LeverPlay()
{
_StreamPlayer.Stream = LeverSound;
_StreamPlayer.Play();
}
public void WinnerPlay()
{
_StreamPlayer.Stream = WinnerSound;
_StreamPlayer.Play();
}
public void Stop()
{
_StreamPlayer.Stop();
}
}
}