33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using GatherAndDefend.Events;
|
|
using System;
|
|
|
|
public class TooltipManager : Singleton<TooltipManager>
|
|
{
|
|
private string _description;
|
|
public string Description { get { return _description; } }
|
|
private string _hp;
|
|
public string Hp { get { return _hp; } }
|
|
private string _damage;
|
|
public string Damage { get { return _damage; } }
|
|
private string _attackSpeed;
|
|
public string AttackSpeed { get { return _attackSpeed; } }
|
|
private bool _tooltipVisibility;
|
|
public bool TooltipVisibility { get { return _tooltipVisibility; } }
|
|
|
|
public void ShowTooltip(string description, string hp, string dmg, string atkSpeed)
|
|
{
|
|
_tooltipVisibility = true;
|
|
_description = description;
|
|
_hp = hp;
|
|
_damage = dmg;
|
|
_attackSpeed = atkSpeed;
|
|
EventAggregator.Instance.GetEvent<TooltipChangedEvent>().Invoke();
|
|
}
|
|
|
|
internal void HideToolTip()
|
|
{
|
|
_tooltipVisibility = false;
|
|
EventAggregator.Instance.GetEvent<TooltipChangedEvent>().Invoke();
|
|
}
|
|
}
|