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);