private void Start() { _button = GetComponent <Button>(); _lswButton = GetComponent <LSWButton>(); _button.onClick.AddListener(ToggleMenuState); _popupMenu = menu.GetComponent <IUiPopup>(); GamePauseHandler.SubscribeCloseEvent(EscCloseEvent); }
public void buttonSetup(bool status) { button = gameObject.GetComponent <LSWButton>(); if (button == null) { return; } if (status) { button.ChangeHighlight(button._pressedColor); button.enabled = false; } else { button.enabled = true; button.ChangeHighlight(button._normalColor); } }
private void Awake() { if (pausePopup != null) { _popupMenu = pausePopup.GetComponent <IUiPopup>(); _popupMenu.OnHide.AddListener(Clock.Unpause); } else { Debug.LogError("Pause popup not found. Pausing disabled."); return; } if (triggerButton != null) { triggerButton.onClick.AddListener(TryPause); } _lswButton = GetComponent <LSWButton>(); }