Exemplo n.º 1
0
 private void SubscribeForEvents()
 {
     try
     {
         LevelManager.OnLevelStart    += SpawnTask;
         HintPopup.OnHintPopupClicked += AddButtonsListeneres;
         letterDeleteButton.onClick.AddListener(() => StaticBehaviors.ClearField(letterFieldsList));
         letterClearButton.onClick.AddListener(() => StaticBehaviors.ClearAll(letterFieldsList));
         hintsButton.onClick.AddListener(() => hintsPopup.gameObject.SetActive(true));
         menuButton.onClick.AddListener(() => menuPopup.gameObject.SetActive(true));
         OnHintUsed += DataManager.Instance.SpendCoins;
     }
     catch (System.NullReferenceException newEx)
     {
         Debug.LogError("There is no reference to " + newEx.Source);
     }
     catch (System.Exception)
     {
         Debug.LogError("You should start the game from 'StartMenu' scene. Or some references are broken");
     }
 }