// Start is called before the first frame update void Start() { score = 0; gameState = STATE_STOP; gameStartTime = Time.time; game_counter = 0; if (projectile == null) { projectile = GameObject.Find("Projectile"); } if (player == null) { player = GameObject.Find("Player"); } projectile.transform.position = new Vector3(1, 2, -10); projectController = new ProjectController(projectile); mainText.text = "Touch screen to start."; scoreText.gameObject.SetActive(false); scoreText2.gameObject.SetActive(false); InterstitialController.getInstance().LoadAds(); #if UNITY_ANDROID GameObject.Find("Button").SetActive(false); #endif }
public void ShowAds() { InterstitialAd interstitial = InterstitialController.getInstance().GetAd(); if (interstitial.IsLoaded()) { interstitial.Show(); } gameState = STATE_STOP; }
private void Awake() { //If we don't currently have a game control... if (instance == null) { //...set this one to be it... instance = this; } //...otherwise... else if (instance != this) { //...destroy this one because it is a duplicate. Destroy(gameObject); } DontDestroyOnLoad(instance); // Sometimes ads will cause ANR. Reduce the work on app started. //RequestInterstitial(); }