private void ShowNotifications(OnShowNotifications e) { int notificationCounter = 0; UIManager.ShowUiElement("NotifyShare"); UIManager.ShowUiElement("NotifyRate"); if (notificationCounter < 3 && _isGiftAvailable) { ++notificationCounter; UIManager.ShowUiElement("NotifyGift"); } if (notificationCounter < 3 && _isRewardedAvailable) { ++notificationCounter; UIManager.ShowUiElement("NotifyRewarded"); } }
private void ShowNotifications(OnShowNotifications e) { DefsGame.CurrentScreen = DefsGame.SCREEN_NOTIFICATIONS; ++_showCounter; PlayerPrefs.SetInt("showCounterGlobal", ++_showCounterGlobal); float ran = Random.value; // Важность - Высокая if (DefsGame.CoinsCount >= 200 && DefsGame.QUEST_CHARACTERS_Counter < DefsGame.FaceAvailable.Length - 1) { _activeNamesList.Add("NotifyNewCharacter"); } if (_isGiftAvailable /*||_activeNamesList.Count == 0 && Random.value < 0.5f ||_activeNamesList.Count == 1 && Random.value < 0.25f*/) { AddNoifyGift(); } // Важность - Средняя if (_activeNamesList.Count < 4 && _isGotNewCharacter && DefsGame.RateCounter == 0) { _activeNamesList.Add("NotifyRate"); _isGotNewCharacter = false; } if (_activeNamesList.Count < 4 && (DefsGame.GameplayCounter == 3 || (DefsGame.GameplayCounter - 3) % 5 == 0) /* && _isRewardedAvailable*/) { _activeNamesList.Add("NotifyRewarded"); } if (_activeNamesList.Count < 4 && (DefsGame.CurrentPointsCount > DefsGame.GameBestScore * 0.5f || _isGotNewCharacter || _activeNamesList.Count == 0 && ran < 0.3f || _activeNamesList.Count == 1 && ran < 0.25f)) { _activeNamesList.Add("NotifyShare"); if (DefsGame.CoinsCount > 100 && DefsGame.CoinsCount < 155) { shareRewardValue = 180 - DefsGame.CoinsCount; } else { if (ran < 0.5f) { shareRewardValue = 45; } else { shareRewardValue = 50; } } _shareText.text = shareRewardValue.ToString(); } // Важность - Низкая if (_giftValue == 0 && _activeNamesList.Count < 4 && (_activeNamesList.Count == 0 && ran > 0.7f || _activeNamesList.Count == 1 && ran > 0.75f || _activeNamesList.Count == 2 && ran > 0.80f)) { _activeNamesList.Add("NotifyGiftWaiting"); } if (_activeNamesList.Count < 4 && (_activeNamesList.Count == 0 && ran > 0.7f || _activeNamesList.Count == 1 && ran > 0.75f || _activeNamesList.Count == 2 && ran > 0.80f) && ran > 0.5f) { AddNotifyNextSkin(); } // Перемешиваем элементы списка, чтобы они располагались рандомно по оси У ShuffleItems(); SetItemsPositions(); ShowItems(); }