mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
Document meeting abilities
This commit is contained in:
1 parent
e381de033e
commit
eb4bff1834
3 files changed
+12
-4
No files matched your search
@@ -10,6 +10,8 @@ public class ShootButton : TargetedMeetingButton
|
||||
|
||||
public override int MaxUses => 0;
|
||||
|
||||
public override float InitialCooldown => 99;
|
||||
|
||||
public override float Cooldown => 10;
|
||||
|
||||
public override LoadableAsset<Sprite> Sprite => ExampleAssets.SharpshootButton;
|
||||
|
||||
@@ -53,7 +53,7 @@ public class MeetingAbilityBehaviour(IntPtr cppPtr) : MonoBehaviour(cppPtr)
|
||||
public void Update()
|
||||
{
|
||||
if (!_init) return;
|
||||
if (_button.Timer < 0)
|
||||
if (_button.Timer < 0.01f)
|
||||
{
|
||||
Renderer.material.SetFloat("_Desat", 0.0f);
|
||||
CooldownText.text = string.Empty;
|
||||
@@ -65,7 +65,7 @@ public class MeetingAbilityBehaviour(IntPtr cppPtr) : MonoBehaviour(cppPtr)
|
||||
CooldownText.text = _button.Timer.ToString(_button.CooldownTimerFormatString, NumberFormatInfo.InvariantInfo);
|
||||
UsesText.text = string.Empty;
|
||||
}
|
||||
SetFillUp(_button.Timer, _button.Cooldown);
|
||||
SetFillUp(_button.Timer, _button.InitialCooldown);
|
||||
}
|
||||
|
||||
public void SetFillUp(float timer, float maxTimer)
|
||||
|
||||
@@ -32,7 +32,13 @@ public abstract class TargetedMeetingButton
|
||||
public bool LimitedUses => MaxUses != 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the cooldown time for this button.
|
||||
/// Gets the cooldown time for this button upon meeting start.
|
||||
/// Defaults to <see cref="Cooldown"/> unless overridden.
|
||||
/// </summary>
|
||||
public virtual float InitialCooldown => Cooldown;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the cooldown time for this button after being used.
|
||||
/// </summary>
|
||||
public abstract float Cooldown { get; }
|
||||
|
||||
@@ -91,7 +97,7 @@ public abstract class TargetedMeetingButton
|
||||
btn.OnClick.AddListener(new System.Action(() => ClickHandler(playerVoteArea)));
|
||||
var abilityBehaviour = btn.gameObject.AddComponent<MeetingAbilityBehaviour>();
|
||||
abilityBehaviour.Initialize(this, playerVoteArea);
|
||||
Timer = Cooldown;
|
||||
Timer = InitialCooldown;
|
||||
return abilityBehaviour;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user