コード例 #1
0
ファイル: ShowAds.cs プロジェクト: ngocdu/TestStartappAds
 //show the ad
 public void ShowAd()
 {
             #if UNITY_ANDROID
     StartAppWrapper.showAd();
     StartAppWrapper.loadAd();
             #endif
 }
コード例 #2
0
ファイル: ShowAds.cs プロジェクト: ngocdu/TestStartappAds
 //show video ad
 public void ShowVideoAd()
 {
             #if UNITY_ANDROID
     StartAppWrapper.showAd();
     StartAppWrapper.loadAd(StartAppWrapper.AdMode.REWARDED_VIDEO);
             #endif
 }
コード例 #3
0
    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);
        }
    }
コード例 #4
0
 void Start()
 {
             #if UNITY_ANDROID
     StartAppWrapper.init();
     StartAppWrapper.showAd();
     StartAppWrapper.loadAd();
             #endif
 }
コード例 #5
0
    // 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
    }
コード例 #6
0
 void Update()
 {
     #if UNITY_ANDROID
     if (Input.GetKeyUp(KeyCode.Escape))
     {
         if (StartAppWrapper.onBackPressed(gameObject.name) == false)
         {
             StartAppWrapper.showAd();
             StartAppWrapper.loadAd();
             exit();
         }
     }
     #endif
 }
コード例 #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);
            }
        }
    }
コード例 #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;
        }
    }
コード例 #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();
            }
        }
    }
コード例 #10
0
ファイル: StartAppADS.cs プロジェクト: CrySkyVR/NavidadFight
 public void onReceiveAd()
 {
     Debug.Log("Ad received. Show ad");
     StartAppWrapper.showAd();
 }
コード例 #11
0
 public void onReceiveAd()
 {
     Debug.Log("Ad received");
     StartAppWrapper.showAd(adDisplayListener);
 }