private void Update() { if (hovering) { if (!hoverBlockActive && timeStartedHovering + 0.8f <= Time.unscaledTime) { SkillButtonsHoverText.HoverText("Flee\n50% success chance"); hoverBlockActive = true; } } }
// Start is called before the first frame update private void Start() { if (GetSkillButtonsHoverText == null) { GetSkillButtonsHoverText = this; } else if (GetSkillButtonsHoverText != this) { Destroy(gameObject); } textbox = textbox != null ? textbox : GetComponentInChildren<TextMeshProUGUI>(); TextBox = textbox; StopHovering(); }
private void StartHovering() { string toSend = Skill.HoverDesc(Player); if (Skill.HasCoolDown) { toSend += $"\nCooldown: {Skill.CoolDown} turns"; if (!userSkill.Ready) { toSend += $"\n{userSkill.TurnsLeft} turns left"; } } SkillButtonsHoverText.HoverText(toSend); hoverBlockActive = true; }
public void OnPointerExit(PointerEventData eventData) { hovering = false; hoverBlockActive = false; SkillButtonsHoverText.StopHovering(); }
private void StopHoverText() { hovering = false; hoverBlockActive = false; SkillButtonsHoverText.StopHovering(); }