void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Debug.Log("Already have AdScript."); Destroy(gameObject); return; } TGSDK.SetDebugModel(true); TGSDK.SDKInitFinishedCallback = (string msg) => { TGSDK.TagPayingUser(TGPayingUser.TGMediumPaymentUser, "CNY", 0, 0); Log("TGSDK finished : " + msg); Debug.Log("TGSDK GetUserGDPRConsentStatus = " + TGSDK.GetUserGDPRConsentStatus()); TGSDK.SetUserGDPRConsentStatus("yes"); Debug.Log("TGSDK GetIsAgeRestrictedUser = "******"no"); float bannerHeight = (float)(Screen.height) * 0.123f; TGSDK.SetBannerConfig("OSL4KTuf4BoLhG0y0yF", "TGBannerNormal", 0, Display.main.systemHeight - bannerHeight, Display.main.systemWidth, bannerHeight, 30); //TGSDK.SetBannerConfig("banner1", "TGBannerNormal", 0, Display.main.systemHeight - 2 * bannerHeight, Display.main.systemWidth, bannerHeight, 30); //TGSDK.SetBannerConfig("banner2", "TGBannerNormal", 0, Display.main.systemHeight - 3 * bannerHeight, Display.main.systemWidth, bannerHeight, 30); }; #if UNITY_IOS && !UNITY_EDITOR TGSDK.Initialize("hP7287256x5z1572E5n7"); #elif UNITY_ANDROID && !UNITY_EDITOR TGSDK.Initialize("2I064Z57Ha35k123CpX3"); //59t5rJH783hEQ3Jd7Zqr #endif Invoke("PreloadAd", 0.5f); }
private void checkResult() { if (isReward) { return; } if (Global.count >= target) { gameOverPanel.SetActive(value: true); blackBg.SetActive(value: true); pauseBtn.SetActive(value: false); replayBtn.SetActive(value: false); txt.text = getLevelClearedText(); if (birds.Count - Global.birdCount > 1 && PlayerPrefs.GetInt("level" + Global.currentLevel) < 3) { PlayerPrefs.SetInt("level" + Global.currentLevel, 3); } else if (birds.Count - Global.birdCount > 0 && PlayerPrefs.GetInt("level" + Global.currentLevel) < 2) { PlayerPrefs.SetInt("level" + Global.currentLevel, 2); } else if (PlayerPrefs.GetInt("level" + Global.currentLevel) < 1) { PlayerPrefs.SetInt("level" + Global.currentLevel, 1); } if (birds.Count - Global.birdCount > 1) { star3.SetActive(value: true); } else if (birds.Count - Global.birdCount > 0) { star2.SetActive(value: true); } else { star1.SetActive(value: true); } return; } gameFailedMsg2.text = getLevelFailedText(); if (!Global.rewardUsed && (AdScript.rewardLoaded || AdScript.IsUnityRewardReady()) && Global.currentLevel != 135 && Global.currentLevel != 213 && Global.target - Global.count <= 2) { rewardCanvas.SetActive(value: true); Text component = GameObject.FindGameObjectWithTag("rewardTxt").GetComponent <Text>(); component.text = getRewardText(); } else if (!gameFailed.activeSelf) { gameFailed.SetActive(value: true); blackBg.SetActive(value: true); star0.SetActive(value: true); int @int = PlayerPrefs.GetInt("SOUND"); if (@int == 1 && null != AudioManager.Instance) { AudioManager.Instance.LevFail.Play(); } pauseBtn.SetActive(value: false); replayBtn.SetActive(value: false); } }
public void OnClickWatchAdVideo() { SoundManager.playButtonClick = true; MenuIsOpen = false; // Advertisement.Show("rewardedVideo"); // GameControl.control.numOfBlocks += 5; AdScript.ShowRewardedAd(); }
public static void LoseGame() { if (scoreKeeper.score > PlayerPrefsManager.GetScore()) { PlayerPrefsManager.SetScore(scoreKeeper.score); } PlayerPrefsManager.SetNumOfCoins(scoreKeeper.GetCoins()); AdScript.ShowAd(true); }
// Start is called before the first frame update private void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } }
} // static singleton void Awake() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); googleAdLoopTurn = 1; StartCoroutine(GetValueFromServerForAdNetwork()); }
} // static singleton void Start() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); googleAdLoopTurn = 1; isOffline = true; StartCoroutine(GetValueFromServerForAdNetwork()); this.RequestBanner(); //InitializeUnityAds(); }
void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } /* * if (PlayerPrefs.GetInt("AdPlayed") != 0) * { * GameObject.Find("SaveScoreAd").GetComponent<Button>().interactable = false; * } * Monetization.Initialize(StoreIdAndroid, false); //kd ke se release game treba da e FALSE * adNotLoaded.SetActive(false); */ }
public void GameOverMethod() { gameOver = true; gamePanel.SetActive(false); gameOverPanel.SetActive(true); gameoverScore.text = "Score: " + score + " m"; if (deathCounter >= 6) { AdScript.showAd(); deathCounter = 0; } deathCounter++; PlayerPrefs.SetInt("DeathCounter", deathCounter); if (highScore < score) { highScore = score; PlayerPrefs.SetFloat("HighScore", highScore); } gameoverHighscore.text = "High score: " + highScore + " m"; scoreTotal = scoreTotal + score; PlayerPrefs.SetFloat("ScoreTotal", scoreTotal); }
void Start() { adScript = GameObject.Find("GameManager").GetComponent <AdScript> (); }
private void checkBottleCollision() { if (Global.isBottleCollission) { return; } gameFailedMsg.text = getLevelFailedText(); if (!rewardCanvas.activeSelf && !Global.rewardUsed && (AdScript.rewardLoaded || AdScript.IsUnityRewardReady()) && Global.currentLevel != 135 && Global.currentLevel != 213 && Global.target - Global.count <= 2) { rewardCanvas.SetActive(value: true); Text component = GameObject.FindGameObjectWithTag("rewardTxt").GetComponent <Text>(); component.text = getRewardText(); } else if (!gameFailed.activeSelf) { gameFailed.SetActive(value: true); blackBg.SetActive(value: true); star0.SetActive(value: true); int @int = PlayerPrefs.GetInt("SOUND"); if (@int == 1 && null != AudioManager.Instance) { AudioManager.Instance.LevFail.Play(); } pauseBtn.SetActive(value: false); replayBtn.SetActive(value: false); } }
public void watchContinueRewardVideo() { AdScript.watchContinueRewardedVideo(); }
public void watchRewardVideo() { AdScript.watchSkipLevelRewardVideo(); }