Esempio n. 1
0
    void Start()
    {
        _playerData       = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;
        _vkapi            = VkApi.VkApiInstance;
        _vkapi.LoggedIn  += onVKLogin;
        _vkapi.LoggedOut += onLogout;
        _downloader       = _vkapi.gameObject.GetComponent <Downloader>();

        playerImage.enabled = false;

        if (_vkapi.IsUserLoggedIn == true && VkApi.CurrentToken != null)
        {
            logInButton.SetActive(false);
            logOutButton.SetActive(true);
            logInRewardText.SetActive(false);
            getUserInfo();
        }
        else
        {
            logInButton.SetActive(true);
            logOutButton.SetActive(false);
        }

        logInVkRewardLabel.text         = "+" + gameSettings.logInReward.ToString();
        joinVkGroupRewardLabel.text     = "+" + gameSettings.joinGroupReward.ToString();
        inviteVkFriendsRewardLabel.text = "+" + (gameSettings.inviteFriendReward * 4).ToString();
    }
Esempio n. 2
0
    void Start()
    {
        _playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;

        if (_playerData.enableBackgroundSound == false)
        {
            backgroundMusicToggle.isOn = true;
        }
        else
        {
            backgroundMusicToggle.isOn = false;
        }

        firstSetUpBackgroundMusic = true;

        if (_playerData.enableSoundsEffects == false)
        {
            soundEffectsToggle.isOn = true;
        }
        else
        {
            soundEffectsToggle.isOn = false;
        }

        firstSetUpSoundEffects = true;
    }
Esempio n. 3
0
    void Start()
    {
        GamePlayerDataController playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;

        _currentLevelBackground = levelBackgrounds[playerData.selectedLevelIndex];
        _currentLevelBackground.SetActive(true);
    }
    void Start()
    {
        _playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;

        string appodealId;

        if (settings.paidGame)
        {
            appodealId = settings.androidHdAppodealId;

                        #if UNITY_IOS
            appodealId = settings.iosHdAppodealId;
                        #endif
        }
        else
        {
            appodealId = settings.androidFreeAppodealId;

                        #if UNITY_IOS
            appodealId = settings.iosFreeAppodealId;
                        #endif
        }

                #if UNITY_ANDROID
        Appodeal.disableNetwork("mopub");
        Appodeal.disableNetwork("amazon_ads");
        Appodeal.disableNetwork("cheetah");
        Appodeal.disableNetwork("yandex");
                #endif

        Appodeal.initialize(appodealId, Appodeal.REWARDED_VIDEO | Appodeal.INTERSTITIAL | Appodeal.BANNER_TOP);
        Appodeal.setRewardedVideoCallbacks(this);
    }
Esempio n. 5
0
 void Start()
 {
     _bonusRechargeTime = gameBalanceData.slowBonusRechargeTime + gameBalanceData.slowBonusMaxTime;
     _playerData        = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;
     _currentBonusTime  = _bonusRechargeTime;
     circularRechargeIndicator.fillAmount = 0f;
 }
Esempio n. 6
0
    public void resumeGame()
    {
        GamePlayerDataController playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;

        if (playerData.completedTutorial == true && pauseGamePopUp.activeSelf == false)
        {
            stopGame = false;
        }
    }
 void Start()
 {
     _playerData                  = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;
     m_tableView.dataSource       = this;
     _lastSelectedFairyIndex      = _playerData.selectedFairyIndex;
     slowBonusPrice.text          = fairiesDataSource.slowBonusPrice.ToString();
     damageBonusPrice.text        = fairiesDataSource.damageBonusPrice.ToString();
     bonusesForAdsCountLabel.text = "+" + fairiesDataSource.scoresForAdsCount.ToString();
 }
Esempio n. 8
0
    void Start()
    {
        _playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;

        if (_playerData.playerUsePromocode == true)
        {
            promoCodeButton.SetActive(false);
        }
    }
    void Start()
    {
        GamePlayerDataController playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;

        _gameBalaceData     = gameDifficultyModes[playerData.selectedLevelIndex];
        _currentStageIndex  = 0;
        _currentPlayerLevel = 0;
        _currentStageTime   = 0;
    }
Esempio n. 10
0
    void Start()
    {
        _playerData      = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;
        _vkapi           = VkApi.VkApiInstance;
        _vkapi.LoggedIn += onVKLogin;
        _downloader      = _vkapi.gameObject.GetComponent <Downloader>();

        joinVkGroupAward.text     = "+" + gameSettings.joinGroupReward.ToString();
        inviteVkFriendsAward.text = "+" + (gameSettings.inviteFriendReward * 4).ToString();
    }
Esempio n. 11
0
    void createNewPlayer()
    {
        GamePlayerDataController playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;

        if (playerData.playerExist == false)
        {
            playerData.createNewPlayer();
            playerData.savePlayerData();
        }
    }
 void Start()
 {
     _playerData           = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;
     _currentTutorialIndex = 0;
     if (_playerData.completedTutorial == false)
     {
         _activeTutorial = true;
         gameLogicController.pauseGame();
         tutorialParts[_currentTutorialIndex].SetActive(true);
     }
 }
Esempio n. 13
0
    void Start()
    {
                #if UNITY_ANDROID
        GooglePlayGames.PlayGamesPlatform.Activate();
                #endif

        _playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;

        if (startGame)
        {
            Social.localUser.Authenticate(logInDebug);
        }
    }
    void Start()
    {
        _playerData          = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;
        _vkapi               = VkApi.VkApiInstance;
        _vkapi.LoggedIn     += onVKLogin;
        vklLogInReward.text  = "+" + gameGlobalSettings.logInReward.ToString();
        fblLogInReward.text  = "+" + gameGlobalSettings.logInReward.ToString();
        promoCodeReward.text = "+" + gameGlobalSettings.promoCodeReward.ToString();

        if (_playerData.playerUsePromocode == true)
        {
            promoCodeButton.SetActive(false);
        }
    }
    public void sendFinishLevelWithScore(int aScore)
    {
        GamePlayerDataController playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;

        Analytics.CustomEvent(gameAnaliticsMessages.finishGame, new Dictionary <string, object> {
            { "Score", aScore },
            { "LevelDifficulty", playerData.selectedLevelIndex },
        });

        FB.LogAppEvent(gameAnaliticsMessages.finishGame, parameters: new Dictionary <string, object> {
            { AppEventParameterName.MaxRatingValue, aScore },
            { AppEventParameterName.Level, playerData.selectedLevelIndex },
        });
    }
    void Start()
    {
        _playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;
        lineRechargeIndicator.fillAmount = 0f;

        if (_playerData.selectedFairyIndex >= 0)
        {
            _playerData.damageBonusCount--;
            GameFairyModel fairyModel = gameBalanceDataSource.dataArray[_playerData.selectedFairyIndex];
            _bonusRechargeTime = fairyModel.fairyCreateSlowBonusTime;
        }

        _currentBonusTime = _bonusRechargeTime;
    }
    void Start()
    {
        _playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;
        setUpPrices();
        setUpCounts();

        if (_playerData.blockAdsInAppBought == true)
        {
            blockAdInAppButton.gameObject.SetActive(false);
        }

                #if UNITY_IOS
        restoreInAppsButton.gameObject.SetActive(true);
                #endif
    }
Esempio n. 18
0
    void Start()
    {
        GamePlayerDataController playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;

        if (settings.paidGame == true || playerData.blockAdsInAppBought == true)
        {
            adsAndHDVersionPad.SetActive(false);
        }

        if (settings.blockAds)
        {
            button.SetActive(false);
        }

        stopAdsCount   = gameBalanceData.maxStopAdsCount;
        countText.text = stopAdsCount.ToString();
    }
 void Start()
 {
     _playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;
     if (_playerData.playerUsePromocode == false)
     {
         rightCodeSign.SetActive(false);
         wrongCodeSign.SetActive(false);
         promoCodeField.gameObject.SetActive(true);
         doneButton.SetActive(true);
     }
     else
     {
         rightCodeSign.SetActive(true);
         wrongCodeSign.SetActive(false);
         promoCodeField.gameObject.SetActive(false);
         doneButton.SetActive(false);
     }
 }
Esempio n. 20
0
    string getPlayerDataFileName()
    {
        GameGlobalSettings globalSettings = ServicesLocator.getServiceForKey(typeof(GameGlobalSettings).Name) as GameGlobalSettings;
        string             fileName       = "/";

        if (globalSettings.paidGame)
        {
            fileName += "paid";
        }

                #if UNITY_STANDALONE_OSX || UNITY_IOS
        fileName += "playerData.bt";
                #else
        fileName += "bamPlayerData.xml";
                #endif

        return(fileName);
    }
Esempio n. 21
0
    void Start()
    {
        _analiticsController = GameObject.FindObjectOfType <GameAnaliticsController>();
        _playerData          = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;

                #if UNITY_ANDROID
        gameSettings.inAppProductRemoveAdID    = gameSettings.inAppProductRemoveAdID.ToLower();
        gameSettings.inAppProductScoreCount1ID = gameSettings.inAppProductScoreCount1ID.ToLower();
        gameSettings.inAppProductScoreCount2ID = gameSettings.inAppProductScoreCount2ID.ToLower();
        gameSettings.inAppProductScoreCount3ID = gameSettings.inAppProductScoreCount3ID.ToLower();
        gameSettings.inAppProductScoreCount4ID = gameSettings.inAppProductScoreCount4ID.ToLower();
        gameSettings.inAppProductScoreCount5ID = gameSettings.inAppProductScoreCount5ID.ToLower();
                #endif

        if (m_StoreController == null)
        {
            initializePurchasing();
        }
    }
Esempio n. 22
0
    void Start()
    {
        _playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;

                #if UNITY_ANDROID
        if (gameGlobalSettings.paidGame)
        {
            OneSignal.StartInit(gameGlobalSettings.hdOneSignalId, gameGlobalSettings.hdOneSignalProjectNumber).EndInit();
        }
        else
        {
            OneSignal.StartInit(gameGlobalSettings.freeOneSignalId, gameGlobalSettings.freeOneSignalProjectNumber).EndInit();;
        }
                #endif

        if (_playerData.notNowPressed == false)
        {
            vkLogInPopUp.SetActive(true);
            GameAnaliticsController analiticsController = GameObject.FindObjectOfType <GameAnaliticsController>();
            analiticsController.showSocialsLogInPopUp();
        }
    }
Esempio n. 23
0
    public void saveCollectedPlayerScore()
    {
        GamePlayerDataController playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;
        int scoreCount = 0;

        if (playerData.selectedLevelIndex == 0)
        {
            scoreCount = _score;
        }

        if (playerData.selectedLevelIndex == 1)
        {
            scoreCount = _score * 2;
        }

        if (playerData.selectedLevelIndex == 2)
        {
            scoreCount = _score * 3;
        }

        playerData.playerScore += scoreCount;
        playerData.savePlayerData();
    }
    void Start()
    {
        _playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;

        if (playMainMenuBackgroundSound)
        {
            currentBackgroundSound = mainMenuBackgroundSound;
        }

        if (playMainGameBackgroundSound)
        {
            _currentBackgroundSoundIndex = Random.Range(0, mainGameBackgroundSounds.Length);
            currentBackgroundSound       = mainGameBackgroundSounds[_currentBackgroundSoundIndex];
            StartCoroutine(playEngineSound());
        }

        currentBackgroundSound.Play();

        if (_playerData.enableBackgroundSound == false)
        {
            currentBackgroundSound.volume = 0;
        }
    }
Esempio n. 25
0
 void Start()
 {
     _playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;
 }
 void Start()
 {
     _playerData = ServicesLocator.getServiceForKey(typeof(GamePlayerDataController).Name) as GamePlayerDataController;
     setUpFacebookSettins();
 }