Beispiel #1
0
    public void OnOutsideclick(int var)
    {
        WaitAgain wg = new WaitAgain();

        wg.OnResumeGame();

        if (PlayerPrefs.GetInt("DIAMOND") > 2)
        {
            PlayerPrefs.SetInt("isGui", 0);
        }
        PlayerPrefs.SetString("ISFROMARMOUR", null);
        Destroy(this.gameObject);
    }
Beispiel #2
0
    void Update()
    {
        DateTime currentTime = System.DateTime.Now;
        int      timeDiff    = (int)currentTime.Subtract(timerStartTime).TotalSeconds;

        time            = waitTime - timeDiff;
        timerLabel.text = "" + time;

        if (time < 1)
        {
            PlayerPrefs.SetInt("isWaiting", 0);
            Destroy(this.gameObject);
            WaitAgain wg = new WaitAgain();
            wg.OnResumeGame();
        }
    }
Beispiel #3
0
    public void Tryagain_fn()
    {
        AudioListener.volume = 0;

        if (InternetStatus())
        {
            int videoCount = PlayerPrefs.GetInt("VIDEOWATCHCOUNT");
            videoCount++;
            PlayerPrefs.SetInt("VIDEOWATCHCOUNT", videoCount);
            Destroy(this.gameObject);
            waitScene = PlayerPrefs.GetString("WaitScene");
            if (waitScene.Equals("LifeOver"))
            {
                PlayerPrefs.SetFloat("HEALTH", 500);
                PlayerPrefs.SetInt("GAMEOVERXI", 2);
            }
            else if (waitScene.Equals("RunEnergy"))
            {
                PlayerPrefs.SetFloat("RE", 500);
            }
            WaitAgain wg = new WaitAgain();
            wg.OnResumeGame();
        }
        if (InternetStatus())
        {
            Vungle.playAd(true, "QuantumLeap");
            Vungle.onAdFinishedEvent += (adFinishedEventArgs) => {
                if (adFinishedEventArgs.IsCompletedView)
                {
                    AudioListener.volume = 1;
//					WaitAgain wg = new WaitAgain ();
//					wg.OnResumeGame ();
                }
                else
                {
                }
            };
        }
        else
        {
        }
    }
    void Update()
    {
        DateTime currentTime = System.DateTime.Now;

        int timeDiff = (int)currentTime.Subtract(timerStartTime).TotalSeconds;

        time = waitTime - timeDiff;
        int minutes = time / 60;         //Divide the guiTime by sixty to get the minutes.
        int seconds = time % 60;         //Use the euclidean division for the seconds.

        //update the label value
        timerLabel.text = string.Format("{0:00} : {1:00}", minutes, seconds);

        if (time < 0)
        {
            PlayerPrefs.SetInt("isWaiting", 0);
//			Time.timeScale = 1;
//			PlayerPrefs.SetInt ("UI_DESABLE", 0);
//			PlayerPrefs.SetInt ("isGui", 0);

            waitScene = PlayerPrefs.GetString("WaitScene");
            if (waitScene.Equals("LifeOver"))
            {
                PlayerPrefs.SetFloat("HEALTH", 500);
                PlayerPrefs.SetInt("GAMEOVERXI", 2);
                WaitAgain wg = new WaitAgain();
                wg.OnResumeGame();
            }
            else if (waitScene.Equals("RunEnergy"))
            {
                WaitAgain wg = new WaitAgain();
                wg.OnResumeGame();
                PlayerPrefs.SetFloat("RE", 500);
                //	PlayerPrefs.SetInt ("walkStickStatus", 0);
            }
            Destroy(this.gameObject);
        }
    }
Beispiel #5
0
    public void videoFn()
    {
        //	runenergy_GameObj=this.gameObject;
//		if (InternetStatus ()) {
//			int videoCount =PlayerPrefs.GetInt("VIDEOWATCHCOUNT");
//			videoCount++;
//			PlayerPrefs.SetInt("VIDEOWATCHCOUNT",videoCount);
//			Destroy (this.gameObject);
//			PlayerPrefs.SetFloat ("RE", max_health);
//		//	ClickFn ();
//			WaitAgain wg = new WaitAgain ();
//			wg.OnResumeGame ();
//
//		}

        if (InternetStatus())
        {
            AudioListener.volume = 0;
//			StartCoroutine(videoTimer());
//			StartCoroutine(videoTimer2());

            int videoCount;
//			int videoCount =PlayerPrefs.GetInt("VIDEOWATCHCOUNT");
//			videoCount++;
//			PlayerPrefs.SetInt("VIDEOWATCHCOUNT",videoCount);
//
//			PlayerPrefs.SetFloat ("RE", max_health);
//			//	ClickFn ();
////			WaitAgain wg = new WaitAgain ();
////			wg.OnResumeGame ();
//			Destroy (this.gameObject);
//
            Vungle.playAd(true, "QuantumLeap");
            try{
                Vungle.onAdFinishedEvent += (adFinishedEventArgs) => {
                    try{
                        if (adFinishedEventArgs.IsCompletedView)
                        {
                            AudioListener.volume = 1;
                            //				WaitAgain wg = new WaitAgain ();
                            //				wg.OnResumeGame ();
                            videoCount = PlayerPrefs.GetInt("VIDEOWATCHCOUNT");
                            videoCount++;
                            PlayerPrefs.SetInt("VIDEOWATCHCOUNT", videoCount);

                            PlayerPrefs.SetFloat("RE", max_health);
                            //	ClickFn ();
                            WaitAgain wg2 = new WaitAgain();
                            wg2.OnResumeGame();
//					if(this.gameObject!=null)
                            Destroy(this.gameObject);
                        }
                        else
                        {
                        }
                    }catch {
                    }
                };
            }catch {
            }
        }
        else
        {
            Destroy(this.gameObject);
            PlayerPrefs.SetString("WaitScene", "RunEnergy");
            if (TryAgain == null)
            {
                TryAgain = (GameObject)Instantiate(TryAgain_pre, new Vector3(0f, 0f, 0f), Quaternion.identity);
            }
        }
    }