rokojori_action_library/Runtime/Actions/Audio/MusicData.cs

27 lines
561 B
C#

using Godot;
namespace Rokojori;
[Tool]
[GlobalClass]
public partial class MusicData: Resource
{
[Export]
public Godot.AudioStream audio;
[Export( PropertyHint.Range, "0,1")]
public float volume = 1f;
[Export( PropertyHint.Range, "-36,36")]
public float pitchSemitonesOffset = 0f;
public override string ToString()
{
var prefix = pitchSemitonesOffset == 0 ? "+/-" : pitchSemitonesOffset > 0 ? "+" : "";
return "MusicData: " + (100 * volume)._FF() + "% (" + prefix + pitchSemitonesOffset + " st) " + audio.ResourcePath;
}
}