SFX
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Godot;
|
||||
using System.IO;
|
||||
|
||||
public partial class Projectile : Node3D
|
||||
{
|
||||
@@ -11,6 +12,10 @@ public partial class Projectile : Node3D
|
||||
public override void _Ready()
|
||||
{
|
||||
Speed = _projectileSpeed;
|
||||
var sfxPlayer = GetTree().Root.GetNode<AudioStreamPlayer>("Main/SFXPlayer");
|
||||
var audioStream = ResourceLoader.Load<AudioStream>("Audio/SFX/shooting.wav");
|
||||
sfxPlayer.Stream = audioStream;
|
||||
sfxPlayer.Play();
|
||||
}
|
||||
|
||||
public float Speed { get; private set; }
|
||||
|
||||
Reference in New Issue
Block a user