Ejemplo n.º 1
0
 public override void Init()
 {
     OnInit.AddListener(InitHealthPanel);
     OnShow.AddListener(ShowHealthPanel);
     OnClose.AddListener(CloseHealthPanel);
     base.Init();
 }
Ejemplo n.º 2
0
    /// <summary>
    /// Проверка корректности введенных данных
    /// </summary>
    /// <param name="initUsernameAndPromocodeHandler">Возращает введенные имя пользователя и промокод</param>
    private void CheckCorrectInputFields(Action <string, string> initUsernameAndPromocodeHandler)
    {
        string username  = _usernameField.text;
        string promoCode = _promoCodeField.text.ToLower();


        if (_usernameField.text == string.Empty || _usernameField.text.Length <= 2)
        {
            _usernameField.textComponent.color = _incorrectColor;
            ShowAlertPopup(AlertType.Invalid_Fields);

            return;
        }


        if (_promoCodeField.text != string.Empty && !Mediator.Instance.GameConfig.PromoCodes.Contains(promoCode))
        {
            _promoCodeField.textComponent.color = _incorrectColor;
            ShowAlertPopup(AlertType.Invalid_Fields);

            return;
        }
        else if (Mediator.Instance.GameConfig.PromoCodes.Contains(promoCode))
        {
            int rewardChips = Mediator.Instance.GameConfig.PromoCodeReward;
            OnClose.AddListener(() => Mediator.Instance.PopupsManager.CreatePopup <RewardPopup>().Init(RewardType.Special, rewardChips));
        }

        initUsernameAndPromocodeHandler?.Invoke(username, promoCode);
    }
Ejemplo n.º 3
0
 public override void Init()
 {
     OnInit.AddListener(InitToolTipPanel);
     OnShow.AddListener(ShowToolTipPanel);
     OnClose.AddListener(CloseToolTipPanel);
     base.Init();
 }
Ejemplo n.º 4
0
    private void Awake()
    {
        OnClose.AddListener(HandleOnClose);

        string result = _levelPassedReference.Value ? "Passed" : "Failed";

        _resultLabel.text = $"Level {_levelReference.Value} {result}";
    }
Ejemplo n.º 5
0
 public override void Init()
 {
     OnInit.AddListener(InitDialogPanel);
     OnShow.AddListener(ShowDialogPanel);
     OnClose.AddListener(CloseDialogPanel);
     GameManager.Singleton.dialogMgr.OnTyping.AddListener(ShowDialog);
     GameManager.Singleton.dialogMgr.OnNextSentence.AddListener(ClearDialog);
     GameManager.Singleton.dialogMgr.OnOff.AddListener(RecycleDialogPanel);
     base.Init();
 }