private void Start() { GameData gameData = SaveLoadSystem.LoadGameData(); hasNoAds = gameData.hasNoAds; SetCorrectSprite(); }
public void LoadGameSlots() { saveSlot1 = SaveLoadSystem.LoadGameData(1); saveSlot2 = SaveLoadSystem.LoadGameData(2); saveSlot3 = SaveLoadSystem.LoadGameData(3); saveSlot4 = SaveLoadSystem.LoadGameData(4); }
private void Start() { GameData gameData = SaveLoadSystem.LoadGameData(); soundEffectsEnabled = gameData.hasSoundEffects; SetCorrectSprite(); }
public void RestartUI() { gameData = SaveLoadSystem.LoadGameData(); HideContinueButton(); newHighScoreImage.gameObject.SetActive(false); SetAllScoresTexts(); if (!shouldKeepContinueButtonHidden) { ShowContinueButtonByChance(); } else { shouldKeepContinueButtonHidden = false; } EnableRetryButtonTouch(); EnableMenuButtonTouch(); if (!gameData.hasNoAds) { if (interstitialAdScore <= 1.0f) { LoadIntersitialAd(); } } }
private void Start() { GameData gameData = SaveLoadSystem.LoadGameData(); musicEnabled = gameData.hasMusic; SetCorrectSprite(); }
public void LoadGameData() { GameData gameData = SaveLoadSystem.LoadGameData(); if (gameData != null) { bestDistance = gameData.bestDistance; collectedCoins = gameData.coin; selectedCar = gameData.selectedCar; //Cars Lock/Unlock Data lockList = gameData.lockList; for (int i = 0; i < lockList.Count; i++) { carDatas[i].unlocked = lockList[i]; } } else { bestDistance = 0.0f; collectedCoins = 0; selectedCar = CarModel.Polo; //Cars Lock/Unlock Data for (int i = 0; i < carDatas.Length; i++) { lockList.Add(carDatas[i].unlocked); } SaveGameData(); } }
public void GameOver() { Game.gameManager.gameOverControl = true; CarDistance.DistanceCalculater(CarDistanceState.Stop); Game.gameManager.CheckBestDistance(CarDistance.GetCurrentDistance()); bestDistanceText.text = "Best: " + SaveLoadSystem.LoadGameData().bestDistance.ToString("F1"); gameOverPanel.gameObject.SetActive(true); }
private void OnMouseUpAsButton() { soundEffectsEnabled = !soundEffectsEnabled; transform.parent.GetComponent <ButtonClickSoundEffect>().PlayIfPossible(); SetCorrectSprite(); GameData gameData = SaveLoadSystem.LoadGameData(); gameData.hasSoundEffects = soundEffectsEnabled; SaveLoadSystem.SaveGameData(gameData); }
private void OnMouseUpAsButton() { musicEnabled = !musicEnabled; transform.parent.GetComponent <ButtonClickSoundEffect>().PlayIfPossible(); SetCorrectSprite(); BackgroundMusicSource.GetComponent <BackgroundMusic>().PlayIfPossible(); GameData gameData = SaveLoadSystem.LoadGameData(); gameData.hasMusic = musicEnabled; SaveLoadSystem.SaveGameData(gameData); }
void Start() { GameData gdata = SaveLoadSystem.LoadGameData(); if (!gdata.hasNoAds) { #if UNITY_ANDROID string appId = "ca-app-pub-5709626172947104~8965185682"; #elif UNITY_IPHONE string appId = "ca-app-pub-5709626172947104~1880902581"; #else string appId = "unexpected_platform"; #endif // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(appId); this.RequestBanner(); } }
public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args) { // A non-consumable product has been purchased by this user. if (String.Equals(args.purchasedProduct.definition.id, kProductIDNoAds, StringComparison.Ordinal)) { Debug.Log(string.Format("ProcessPurchase: PASS. Product: '{0}'", args.purchasedProduct.definition.id)); // The non-consumable item has been successfully purchased, grant this item to the player. GameData gameData = SaveLoadSystem.LoadGameData(); gameData.hasNoAds = true; SaveLoadSystem.SaveGameData(gameData); GetComponent <MenuUIHandler>().UpdateNoAdsButton(); } // Or ... an unknown product has been purchased by this user. Fill in additional products here.... else { Debug.Log(string.Format("ProcessPurchase: FAIL. Unrecognized product: '{0}'", args.purchasedProduct.definition.id)); } // Return a flag indicating whether this product has completely been received, or if the application needs // to be reminded of this purchase at next app launch. Use PurchaseProcessingResult.Pending when still // saving purchased products to the cloud, and when that save is delayed. return(PurchaseProcessingResult.Complete); }