diff --git a/Assets/Scripts/UI/PauseMenu.cs b/Assets/Scripts/UI/PauseMenu.cs index 777edcf89..cadd5408d 100644 --- a/Assets/Scripts/UI/PauseMenu.cs +++ b/Assets/Scripts/UI/PauseMenu.cs @@ -57,7 +57,7 @@ namespace HeavenStudio.Common isPaused = true; canPick = false; optionSelected = 0; - ChooseOption((Options)optionSelected, false); + ChooseCurrentOption(); } void UnPause(bool instant = false) @@ -130,10 +130,9 @@ namespace HeavenStudio.Common { foreach (Transform t in optionHolder.transform) { - if (t.GetComponent().OverlapPoint(PlayerInput.GetInputController(1).GetPointer())) + if (t.TryGetComponent(out Collider2D c) && c.OverlapPoint(PlayerInput.GetInputController(1).GetPointer())) { int idx = t.GetSiblingIndex(); - ChooseOption((Options)idx, idx != optionSelected); optionSelected = idx; break; }