17 lines
331 B
C#
17 lines
331 B
C#
|
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();
|
||
|
}
|
||
|
}
|