Beispiel #1
0
 //show the ad
 public void ShowAd()
 {
             #if UNITY_ANDROID
     StartAppWrapper.showAd();
     StartAppWrapper.loadAd();
             #endif
 }
Beispiel #2
0
 //show video ad
 public void ShowVideoAd()
 {
             #if UNITY_ANDROID
     StartAppWrapper.showAd();
     StartAppWrapper.loadAd(StartAppWrapper.AdMode.REWARDED_VIDEO);
             #endif
 }
    public void OnPointerClick(PointerEventData eventData)
    {
        Time.timeScale = 1;
        if (showAds == true)
        {
                        #if UNITY_ANDROID
            StartAppWrapper.showAd();
            StartAppWrapper.loadAd();
                        #endif
        }

        /*if (Advertisement.IsReady ()) {
         *      Advertisement.Show ();
         * }*/
        level_settings.GetComponent <Level_settings> ().Save_User_Data();
        for (int i = 0; i < activate.Count; i++)
        {
            activate[i].SetActive(true);
        }

        for (int i = 0; i < deactivate.Count; i++)
        {
            deactivate[i].SetActive(false);
        }
    }
 void Start()
 {
             #if UNITY_ANDROID
     StartAppWrapper.init();
     StartAppWrapper.showAd();
     StartAppWrapper.loadAd();
             #endif
 }
    // Use this for initialization
    public void ShowAdd()
    {
                #if UNITY_ANDROID
        StartAppWrapper.loadAd(StartAppWrapper.AdMode.REWARDED_VIDEO);
        StartAppWrapper.showAd();
        StartAppWrapper.loadAd(StartAppWrapper.AdMode.REWARDED_VIDEO);
                #endif

                #if UNITY_EDITOR
        GameDataTracker.AD_Reward = true;
                #endif
    }
 void Update()
 {
     #if UNITY_ANDROID
     if (Input.GetKeyUp(KeyCode.Escape))
     {
         if (StartAppWrapper.onBackPressed(gameObject.name) == false)
         {
             StartAppWrapper.showAd();
             StartAppWrapper.loadAd();
             exit();
         }
     }
     #endif
 }
Beispiel #7
0
    // Update is called once per frame
    void Update()
    {
        //text.text = "Score: " + score;
        text.text = "Score: " + GameDataTracker.GameScore;
        if (GameDataTracker.Lives <= 0)
        {           //SHOW STARTAPP INTERSTIATIAL EVERY 2 RUNS
            if (GameDataTracker.GameRuns % 3 == 0 && GameDataTracker.AD_AlreadyShown == false)
            {
                //if true => Show ad
                                #if UNITY_ANDROID
                StartAppWrapper.showAd();
                StartAppWrapper.loadAd();
                                #endif
                GameDataTracker.AD_AlreadyShown = true;
            }
            //Report Score to leaderboard


            //
            GameObject ExitDoor = GameObject.FindGameObjectWithTag("ExitDoor");
            Destroy(ExitDoor);
            GameObject BALL = GameObject.FindGameObjectWithTag("Ball");
            DestroyObject(BALL);
            // ... tell the animator the game is over.
            anim.SetTrigger("GameOver");

            // .. increment a timer to count up to restarting.
            restartTimer += Time.deltaTime;
            //ADD SUCCES SCREEN MOT GAMER OVER AND SHOW PROGRESS
            // .. if it reaches the restart delay...
            if (restartTimer >= restartDelay)
            {
                GameDataTracker.Reset();
                // .. then reload the currently loaded level.
                //Application.LoadLevel(Application.loadedLevel);
                UnityEngine.SceneManagement.SceneManager.LoadScene("MainMenu", UnityEngine.SceneManagement.LoadSceneMode.Single);
            }
        }
    }
Beispiel #8
0
    IEnumerator toto44()
    {
        if (StartAppWrapper.showAd())
        {
            ok = true;
            Debug.Log("Startapp Ok");
            StartCoroutine(View(false));
            StartCoroutine(toto());
            //StartCoroutine (check_click ());
        }

        yield return(new WaitForSeconds(2));

        if (!ok)
        {
            Debug.LogError("Startapp Fail");
            StartCoroutine(View(true));
        }
        else
        {
            ok = false;
        }
    }
Beispiel #9
0
    public void OnPointerClick(PointerEventData eventData)
    {
                #if UNITY_ANDROID
        StartAppWrapper.showAd();
        StartAppWrapper.loadAd(StartAppWrapper.AdMode.REWARDED_VIDEO);
                #endif

        if (Application.internetReachability != NetworkReachability.NotReachable)
        {
            if (gold == true)
            {
                gold_menu.SetActive(true);
                PlayerPrefs.SetInt("gold", PlayerPrefs.GetInt("gold") + amount);
                PlayerPrefs.Save();
            }
            else
            {
                gem_menu.SetActive(true);
                PlayerPrefs.SetInt("gem", PlayerPrefs.GetInt("gem") + amount);
                PlayerPrefs.Save();
            }
        }
    }
Beispiel #10
0
 public void onReceiveAd()
 {
     Debug.Log("Ad received. Show ad");
     StartAppWrapper.showAd();
 }
 public void onReceiveAd()
 {
     Debug.Log("Ad received");
     StartAppWrapper.showAd(adDisplayListener);
 }