public void continue_game() { SoundManager.instance.PlayButton(); int jmlCoinsNow = CoinTimerHandler.instance.countCoin; if (bWatchedAds) { jmlCoinsNow += 2; } if (jmlCoinsNow >= 2) { jmlCoinsNow -= 2; PlayerPrefs.SetInt(PlayerPrefHandler.keyCoin, jmlCoinsNow); CoinTimerHandler.instance.countCoin = jmlCoinsNow; sc_stage scStage = GameObject.Find("txtStage").GetComponent <sc_stage> (); scStage.levelAktif = scriptStage.levelAktif; PlayerPrefs.SetInt(PlayerPrefHandler.keyLevelAktif, scriptStage.levelAktif); //PlayerPrefs.SetInt ("highscore", 0); PlayerPrefs.SetInt(PlayerPrefHandler.keyPause, 0); PlayerPrefs.Save(); GameDataManager.instance.SendPlayResult(GameDataManager.instance.gameID.ToString(), "0", jmlCoinsNow.ToString(), PlayerPrefs.GetInt(PlayerPrefHandler.keyCurrentScore).ToString(), PlayerPrefs.GetInt(PlayerPrefHandler.keyLevelAktif).ToString()); Application.LoadLevel("3Dbasketball"); } else { cvsNoCoin.gameObject.SetActive(true); } }
// Use this for initialization void Start() { textTarget = GetComponent <Text> (); textTarget.text = "000"; targetLevel = 40; scriptStage = GameObject.Find("txtStage").GetComponent <sc_stage>(); if (scriptStage.levelAktif == 1) { targetLevel = 40; //targetLevel=1; textTarget.text = "" + targetLevel; } else if (scriptStage.levelAktif == 2) { targetLevel = 150; //targetLevel=2; textTarget.text = "" + targetLevel; } else if (scriptStage.levelAktif == 3) { targetLevel = 250; //targetLevel=3; textTarget.text = "" + targetLevel; } else if (scriptStage.levelAktif == 4) { targetLevel = 999; //targetLevel=4; textTarget.text = "-"; } //targetLevel = 0; //textTarget.text = "0"; }
// Use this for initialization void Start() { textOpeningBonusStage.gameObject.SetActive(false); tscale = Time.timeScale; Debug.Log("Time Scale 1 : " + Time.timeScale); //canvasGameOver = GameObject.Find ("Canvas_gameover").GetComponent<Canvas>(); canvasGameOver.gameObject.SetActive(false); imgNewHighScore.gameObject.SetActive(false); //GameObject.Find ("imgGameOver").transform.localScale = new Vector3 (3f,3f,3f); //cvsPassLevel = GameObject.Find ("Canvas_pass_level").GetComponent<Canvas> (); cvsPassLevel.gameObject.SetActive(false); //GameObject.Find ("Canvas_gameover").renderer.enabled = false; textWaktu = GetComponent <Text> (); //textOpening = GameObject.Find("Text_opening").GetComponent<Text> (); canvasOpening.gameObject.SetActive(true); canvasOpeningScale = new Vector3(canvasOpening.transform.localScale.x, canvasOpening.transform.localScale.y, canvasOpening.transform.localScale.z); //sc_stage script = GameObject.Find("txtStage").gameObject.GetComponent<sc_stage>(); scriptStage = GameObject.Find("txtStage").GetComponent <sc_stage>(); scriptScore = GameObject.Find("txtScore").GetComponent <sc_score>(); if (scriptStage.levelAktif == 1) { waktu_main = 60; waktu3Point = -1; //waktu3Point=20; //if(PlayerPrefs.GetString(PlayerPrefHandler.keyLoginActive)=="guest") { // PlayerPrefs.SetInt (PlayerPrefHandler.keyUserTiket, 0); //} } else if (scriptStage.levelAktif == 2) { waktu_main = 60; waktu3Point = 20; } else if (scriptStage.levelAktif == 3) { waktu_main = 60; waktu3Point = 40; } else if (scriptStage.levelAktif == 4) { waktu_main = 60; waktu3Point = 20; } //waktu_main = 5; PlayerPrefs.Save(); textWaktu.text = "" + waktu_main; }