예제 #1
0
        public RateMePopup(GameData gameData, PlayerData playerData, APIManager apiManager, Wallet wallet, LocalisationManager localisation, string genericPopupID,
                           object rateMessage, object rateConfirmButtonLabel, object rateDeclineButtonLabel,
                           object rewardMessage, object rewardConfirmationButtonLabel,
                           int rateConfirmButtonColorID = 0, int rateDeclineButtonColorID = 0, int rewardConfirmationButtonColorID = 0) : base(apiManager, localisation, genericPopupID, null, null)
        {
            _data       = gameData.Get <RateMePopupData>().First;
            _playerData = playerData.GetModel <RateMePopupModel>();

            if (_data == null)
            {
                throw new UnityException("No RateMePopupData found in game data");
            }

            if (_playerData == null)
            {
                throw new UnityException("No RateMePopupModel found in player data");
            }

            _wallet = wallet;

            CreateButtonKeys(BUTTON_YES, rateConfirmButtonLabel, rateConfirmButtonColorID);
            CreateButtonKeys(BUTTON_NO, rateDeclineButtonLabel, rateDeclineButtonColorID);
            CreateButtonKeys(BUTTON_REWARD, rewardConfirmationButtonLabel, rewardConfirmationButtonColorID);

            CreateLocalisationKey(MESSAGE_REWARD, rewardMessage);
            CreateLocalisationKey(MESSAGE_RATE, rateMessage);
        }
예제 #2
0
        public bool Merge(IPlayerDataModel data)
        {
            RateMePopupModel other = (RateMePopupModel)data;

            if (other != null)
            {
                if (other._eventsCounter > _eventsCounter)
                {
                    _eventsCounter = other._eventsCounter;
                }

                if (other._displayCounter > _displayCounter)
                {
                    _displayCounter = other._displayCounter;
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }