fix SetUses bug in buttons and make effect and use limit optional

This commit is contained in:
XtraCube committed 2024-12-27 18:48:43 -05:00
1 parent 82050b9d2b
commit 786450c7c1
4 files changed
+14 -13

No files matched your search

@@ -8,6 +8,7 @@ using System.Collections;
using UnityEngine;
namespace MiraAPI.Example.Buttons.Teleporter;
[RegisterButton]
public class TeleportButton : CustomActionButton
{
@@ -17,15 +18,15 @@ public class TeleportButton : CustomActionButton
public override float EffectDuration => OptionGroupSingleton<TeleporterOptions>.Instance.TeleportDuration;
public override int MaxUses => 0;
public override LoadableAsset<Sprite> Sprite => ExampleAssets.TeleportButton;
public static bool IsZoom { get; private set; }
public override bool Enabled(RoleBehaviour? role)
{
return role is TeleporterRole;
}
protected override void OnClick()
{
Coroutines.Start(ZoomOutCoroutine());