From cf10bf3f90bb513d0698b9343fea8534de176a80 Mon Sep 17 00:00:00 2001 From: Pasha Bibko <156938226+PashaBibko@users.noreply.github.com> Date: Thu, 15 Jan 2026 13:03:12 +0000 Subject: [PATCH] Improved feel of Troll Window --- Assets/Scripts/Windows/TrollWindow.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Windows/TrollWindow.cs b/Assets/Scripts/Windows/TrollWindow.cs index 46a2a1a..b4c7a7d 100644 --- a/Assets/Scripts/Windows/TrollWindow.cs +++ b/Assets/Scripts/Windows/TrollWindow.cs @@ -5,7 +5,7 @@ namespace InterfaceOff public class TrollWindow : WindowBase { private int m_Health = int.MaxValue; - private bool m_SpawnOnRight = true; + private bool m_SpawnOnRight; public override void OnWindowInstantiation() { @@ -21,6 +21,9 @@ namespace InterfaceOff public override void OnWindowCloseButtonClicked() { + /* Removes info text as it can overlap with the close button */ + Components.InfoText.text = string.Empty; + /* Decreases health and destroys if at 0 */ m_Health--; if (m_Health <= 0) @@ -30,7 +33,7 @@ namespace InterfaceOff } /* If not at zero randomly moves the close button */ - float randX = m_SpawnOnRight ? Random.Range(0, 80) : Random.Range(-80, 0); + float randX = m_SpawnOnRight ? Random.Range(20, 80) : Random.Range(-80, -20); m_SpawnOnRight = !m_SpawnOnRight; // Makes sure the close button is semi far away Components.CloseButtonRectTransform.anchoredPosition = new Vector2(randX, 0);