diff --git a/MiraAPI.Example/ExampleButton.cs b/MiraAPI.Example/ExampleButton.cs new file mode 100644 index 0000000..d7058bc --- /dev/null +++ b/MiraAPI.Example/ExampleButton.cs @@ -0,0 +1,26 @@ +using MiraAPI.Hud; +using MiraAPI.Utilities.Assets; +using Reactor.Utilities; +using UnityEngine; + +namespace MiraAPI.Example; + +[RegisterButton] +public class ExampleButton : CustomActionButton +{ + public override string Name => "Example Button"; + public override float Cooldown => 5f; + public override float EffectDuration => 0f; + public override int MaxUses => 5; + public override LoadableAsset Sprite { get; } = new LoadableResourceAsset("MiraAPI.Resources.ExampleButton.png"); + + protected override void OnClick() + { + Logger.Info("Example button clicked!"); + } + + public override bool Enabled(RoleBehaviour role) + { + return true; + } +} \ No newline at end of file diff --git a/MiraAPI/MiraAPI.csproj b/MiraAPI/MiraAPI.csproj index 20eb5f6..c1e2979 100644 --- a/MiraAPI/MiraAPI.csproj +++ b/MiraAPI/MiraAPI.csproj @@ -16,11 +16,12 @@ - - - - - + + + + + + @@ -31,7 +32,7 @@ - compile; build; native; contentfiles; analyzers; buildtransitive + compile; build; native; contentfiles; analyzers; buildtransitive diff --git a/MiraAPI/Resources/ExampleButton.png b/MiraAPI/Resources/ExampleButton.png new file mode 100644 index 0000000..c1680cc Binary files /dev/null and b/MiraAPI/Resources/ExampleButton.png differ