rokojori_action_library/Runtime/Actions/Audio/StopMusic.cs

34 lines
604 B
C#
Raw Normal View History

2026-05-25 10:31:21 +00:00
using Godot;
using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori
{
[Tool][GlobalClass]
public partial class StopMusic:Action
{
[Export]
public AudioStreamPlayer music;
[ExportToolButton( "Set Reference Name" )]
public Callable setReferencedNameButton => Callable.From(
()=>
{
if ( music == null )
{
this.Name = "Stop (nothing)";
}
else
{
this.Name = "Stop " + music.Name;
}
}
);
protected override void _OnTrigger()
{
music.Stop();
}
}
}