mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
cancelable abilities
This commit is contained in:
1 parent
2237d3a2df
commit
5f67960b28
2 files changed
+48
-8
No files matched your search
@@ -0,0 +1,29 @@
|
||||
using MiraAPI.Hud;
|
||||
using MiraAPI.Utilities.Assets;
|
||||
using UnityEngine;
|
||||
|
||||
namespace MiraAPI.Example.Buttons;
|
||||
|
||||
public class ThinkButton : CustomActionButton
|
||||
{
|
||||
public override string Name => "Think";
|
||||
public override float Cooldown => 10f;
|
||||
public override float EffectDuration => 10f;
|
||||
public override bool EffectCancelable => true;
|
||||
public override LoadableAsset<Sprite> Sprite => ExampleAssets.ExampleButton;
|
||||
protected override void OnClick()
|
||||
{
|
||||
// This button does absolutely nothing besides changing its text
|
||||
Button!.OverrideText("Thinking...");
|
||||
}
|
||||
|
||||
public override void OnEffectEnd()
|
||||
{
|
||||
Button!.OverrideText("Think");
|
||||
}
|
||||
|
||||
public override bool Enabled(RoleBehaviour? role)
|
||||
{
|
||||
return role != null && role.IsImpostor;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user