// Fetch references and listeners once the game starts. void Start() { lobbyNetwork = LobbyNetwork.Instance; button = GetComponent<Button>(); scaleOnHover = GetComponent<ScaleOnHover>(); button.onClick.AddListener(OnClick); // Disable if button not interactable if (!button.interactable) this.enabled = false; }
/// <summary> /// Stops displaying the 'searching' text and resets the timer /// </summary> /// <remarks> /// Called when a player stops searching for a game (searching cancelled) /// </remarks> public void OnSearchingStop() { isSearching = false; timeElapsed = 0; timer.text = "00:00"; titleText.text = LocalisationManager.instance.GetValue("lobby_play"); timer.gameObject.SetActive(false); cancelButton.gameObject.SetActive(false); StopCoroutine("RunTimer"); StopCoroutine("SearchingText"); ScaleOnHover scaleOnHover = GetComponent <ScaleOnHover>(); if (scaleOnHover != null) { GetComponent <ScaleOnHover>().enabled = true; } }