Пример #1
0
 private void SetPopUp(PopUpInfo info)
 {
     _isConfirming      = false;
     _index             = 0;
     _currentPopUpIndex = 0;
     _currentPopUp      = info;
     header.text        = _currentPopUp.header;
     body.text          = "";
     SetInfo(_currentPopUp.actions[0]);
     canvas.enabled = true;
     Events.Instance.popUpStatus?.Invoke(true);
     Events.Instance.playPopUpSound?.Invoke();
 }
Пример #2
0
        private void SetNotification(PopUpInfo info)
        {
            for (int i = 0; i < _notifications.Count; i++)
            {
                if (_notifications[i].gameObject.activeSelf)
                {
                    continue;
                }
                _notifications[i].transform.SetAsLastSibling();
                _notifications[i].Set(GetUniqueKeys(info.closeKeyCount), GetUniqueKeys(1)[0], info);
                _notifications[i].gameObject.SetActive(true);
                return;
            }

            if (_notifications.Count >= maxNotifications)
            {
                return;
            }
            _notifications.Add(Instantiate(prefab, content).GetComponent <Notification>());

            _notifications[_notifications.Count - 1]
            .Init(_notifications.Count - 1, CloseNotification, OpenNotification);
            _notifications[_notifications.Count - 1].Set(GetUniqueKeys(info.closeKeyCount), GetUniqueKeys(1)[0], info);
        }