public void Start() { _playGamesService = ServiceLocator.GetService <PlayGamesService>(); // If we haven't set up the Unity Purchasing reference if (m_StoreController == null) { // Begin to configure our connection to Purchasing InitializePurchasing(); } }
void Awake() { _button = GetComponent <Button>(); _playGamesService = ServiceLocator.GetService <PlayGamesService>(); _uiService = ServiceLocator.GetService <UIService>(); _notificationService = ServiceLocator.GetService <NotificationService>(); _button.onClick.AddListener(GetFreeCoins); time = 10800; TimerEnded += OnTimerEnded; }
// Start is called before the first frame update void Awake() { _button.onClick.AddListener(ResetData); _playGamesService = ServiceLocator.GetService <PlayGamesService>(); _uiService = ServiceLocator.GetService <UIService>(); if (!PlayerPrefs.HasKey("NeedReset1")) { ResetData(); PlayerPrefs.SetString("NeedReset1", String.Empty); } Destroy(gameObject); }
private void Awake() { _uiService = ServiceLocator.GetService <UIService>(); _playGamesService = ServiceLocator.GetService <PlayGamesService>(); _skinService = ServiceLocator.GetService <SkinService>(); _achievementsService = ServiceLocator.GetService <AchievementsService>(); _skinsList = new List <SkinButton>(); _getRandomSkin.onClick.AddListener(GetRandomSkin); _pages.ForEach(page => _skinsList.AddRange(page.GetComponentsInChildren <SkinButton>())); _skinService.UpdateSelectedTrainPreview += UpdateSelectedPreview; UpdateSkins(); _selectedTrainPreview.sprite = _skinService.GetCurrentSkin(); }
private void Awake() { _uiService = ServiceLocator.GetService <UIService>(); _adsService = ServiceLocator.GetService <AdsService>(); _playGamesService = ServiceLocator.GetService <PlayGamesService>(); _adsService.FreeCoins += AddCoins; IAPManager.Instance.CoinsPurchased += AddCoins; _adsCoins.onClick.AddListener(GetCoinsForAds); _coins2000.onClick.AddListener(() => { BuyCoins(2000); }); _coins5000.onClick.AddListener(() => { BuyCoins(5000); }); _coins12000.onClick.AddListener(() => { BuyCoins(12000); }); _coins2000.GetComponentInChildren <Text>().text = IAPManager.Instance.GetCoinsPrice(2000); _coins5000.GetComponentInChildren <Text>().text = IAPManager.Instance.GetCoinsPrice(5000); _coins12000.GetComponentInChildren <Text>().text = IAPManager.Instance.GetCoinsPrice(12000); }
private void Awake() { _levelService = ServiceLocator.GetService <LevelService>(); _adsService = ServiceLocator.GetService <AdsService>(); _gameDataService = ServiceLocator.GetService <GameDataService>(); _uiService = ServiceLocator.GetService <UIService>(); _playGamesService = ServiceLocator.GetService <PlayGamesService>(); _achievementsService = ServiceLocator.GetService <AchievementsService>(); _bonusButton.onClick.AddListener(_adsService.ShowBonusVideoAdvertisement); _timerButton.TimerEnded += delegate { _bonusButton.gameObject.SetActive(false); }; _adsService.BonusAdvertisementUpdate += delegate(bool isReady) { _bonusButton.interactable = isReady; }; _adsService.BonusCoins += GetBonus; _uiService.OpenEndGameMenu += Open; _uiService.OpenPauseMenu += () => SetActivePanel(false); _exitToMenu.onClick.AddListener(ExitToMainMenu); _uiService.EndGameBackButton += ExitToMainMenu; }
/// <summary> /// Create or find systems /// </summary> void CreateSystems() { // find objects Background = FindObjectOfType <BackgroundController>(); cutsceneManager = FindObjectOfType <CutsceneManager>(); tutorialManager = FindObjectOfType <TutorialManager>(); audioManager = FindObjectOfType <AudioManager>(); WeaponsStats = new AllWeaponsStats(weaponsList.Data); AmmoStats = new AllAmmoStats(ammoList.Data); spawnersController = new SpawnersController(); SettingsSystem = new SettingsSystem(Settings); Shop = new ShopSystem(); audioSettingsHandler = new AudioSettingsHandler(); timeController = new TimeController(Time.fixedDeltaTime); ObjectPool = new ObjectPool(objectPoolPrefabs, transform); ParticlesPool = new ParticlesPool(particlesPoolPrefabs, transform); #if UNITY_ANDROID && !UNITY_EDITOR OnlineService = new PlayGamesService(); #endif }