first commit
This commit is contained in:
16
scripts/user_interface/ButtonCommon.cs
Normal file
16
scripts/user_interface/ButtonCommon.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public class ButtonCommon : Button
|
||||
{
|
||||
AudioStreamPlayer audio;
|
||||
|
||||
public override void _Ready() {
|
||||
this.Connect("pressed", this, nameof(event_Btn_pressed));
|
||||
audio = GetNode<AudioStreamPlayer>("AudioClick");
|
||||
}
|
||||
|
||||
private void event_Btn_pressed() {
|
||||
audio.Play();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user