// Update is called once per frame void Update() { if (success) { return; } if (topView && IsSuccess()) { GameObject.Find("Box/FrontSurface").SetActive(false); GameObject.Find("Box/LeftSurface").SetActive(false); GameObject.Find("Box/RightSurface").SetActive(false); GameObject.Find("Box/BackSurface").SetActive(false); GameObject.Find("Box/TopSurface").SetActive(false); GameObject.Find("Box/DownSurface").SetActive(false); GameObject.Find("Eagle_00").GetComponent <birdBehaviour> ().escape = true; int starNum = 1; if (RotateCount == Global.minStep) { starNum = 3; } else if (RotateCount <= Global.minStep + 2) { starNum = 2; } obj.SetActive(true); obj.GetComponent <GameOver>().hideButtons(); GameObject.Find("Canvas/GameOverCanvas/Stars").GetComponent <RawImage>().texture = Resources.Load("stars/success" + starNum) as Texture; if (PlayerPrefs.GetInt("level" + Global.level) < starNum) { PlayerPrefs.SetInt("level" + Global.level, starNum); } success = true; } if (onRotate) { if (topView) { cameraTransform.RotateAround(new Vector3(0, -1.5f, 0), new Vector3(1, 0, 1), -54.74f / maxProcess); cameraTransform.Rotate(0, 0, 45f / maxProcess); cameraCamera.orthographicSize = 5 - 2.0f * process / maxProcess; ((GameObject)surfaces[Box.FRONT]).GetComponent <Transform>().RotateAround(new Vector3(0, 0, -1.5f), new Vector3(1, 0, 0), -90f / maxProcess); ((GameObject)surfaces[Box.BACK]).GetComponent <Transform>().RotateAround(new Vector3(0, 0, 1.5f), new Vector3(1, 0, 0), 90f / maxProcess); ((GameObject)surfaces[Box.LEFT]).GetComponent <Transform>().RotateAround(new Vector3(-1.5f, 0, 0), new Vector3(0, 0, 1), 90f / maxProcess); ((GameObject)surfaces[Box.RIGHT]).GetComponent <Transform>().RotateAround(new Vector3(1.5f, 0, 0), new Vector3(0, 0, 1), -90f / maxProcess); process++; if (process == maxProcess) { GameObject.Find("TopSurface").GetComponent <Add_point_line> ().enable_all(); GameObject.Find("FrontSurface").GetComponent <Add_point_line> ().enable_all(); GameObject.Find("LeftSurface").GetComponent <Add_point_line> ().enable_all(); GameObject.Find("RightSurface").GetComponent <Add_point_line> ().enable_all(); GameObject.Find("BackSurface").GetComponent <Add_point_line> ().enable_all(); topView = false; onRotate = false; process = 0; Box.ToggleRotate(); cameraCamera.orthographicSize = 3; } } else { cameraTransform.RotateAround(new Vector3(0, -1.5f, 0), new Vector3(1, 0, 1), 54.74f / maxProcess); cameraTransform.Rotate(0, 0, -45f / maxProcess); cameraCamera.orthographicSize = 3 + 2.0f * process / maxProcess; ((GameObject)surfaces[Box.FRONT]).GetComponent <Transform>().RotateAround(new Vector3(0, 0, -1.5f), new Vector3(1, 0, 0), 90f / maxProcess); ((GameObject)surfaces[Box.BACK]).GetComponent <Transform>().RotateAround(new Vector3(0, 0, 1.5f), new Vector3(1, 0, 0), -90f / maxProcess); ((GameObject)surfaces[Box.LEFT]).GetComponent <Transform>().RotateAround(new Vector3(-1.5f, 0, 0), new Vector3(0, 0, 1), -90f / maxProcess); ((GameObject)surfaces[Box.RIGHT]).GetComponent <Transform>().RotateAround(new Vector3(1.5f, 0, 0), new Vector3(0, 0, 1), 90f / maxProcess); process++; if (process == maxProcess) { cameraCamera.orthographicSize = 5; topView = true; onRotate = false; process = 0; Box.ToggleRotate(); } } } }
void UpdateHighscore(bool success) { worldBest = Highscores.instance.highscore; worldBestUI.text = worldBest + ""; PlayerPrefs.SetInt("worldbest", worldBest); }
public void StartingGame() { _playercontroller.enabled = true; _maincamera.enabled = true; PlayerPrefs.SetInt("StartGame", 1); Background.SetActive(false); }
public void SetInt(PrefsKey prefsKey, int value) { PlayerPrefs.SetInt(prefsKey.ToString(), value); }
public void addCoin(int angka) { coin += angka; PlayerPrefs.SetInt("coins", coin); textCoin.text = "coin : " + coin; }
public void reSetSave() { PlayerPrefs.SetInt("triesScore", 1); triesScore = 0; }
void CheckBestScore() { switch (gm.roundDuration) { case 15: if (tapCount > PlayerPrefs.GetInt("Best15")) { if (tapCount == 50) { UnlockAchievement(TapTapRevolutionResources.achievement_the_50_in_15); } else if (tapCount == 100) { UnlockAchievement(TapTapRevolutionResources.achievement_the_100_in_15); } else if (tapCount == 150) { UnlockAchievement(TapTapRevolutionResources.achievement_the_150_in_15); } else if (tapCount == 200) { UnlockAchievement(TapTapRevolutionResources.achievement_the_200_in_15); } else if (tapCount > 250) { UnlockAchievement(TapTapRevolutionResources.achievement_you_are_15__awesome); } PlayerPrefs.SetInt("Best15", tapCount); gm.BestScoreLimited.text = "Best Score: " + PlayerPrefs.GetInt("Best15").ToString(); } break; case 30: if (tapCount > PlayerPrefs.GetInt("Best30")) { if (tapCount == 100) { UnlockAchievement(TapTapRevolutionResources.achievement_the_100_in_30); } else if (tapCount == 200) { UnlockAchievement(TapTapRevolutionResources.achievement_the_200_in_30); } else if (tapCount == 300) { UnlockAchievement(TapTapRevolutionResources.achievement_the_300_in_30); } else if (tapCount == 400) { UnlockAchievement(TapTapRevolutionResources.achievement_the_400_in_30); } else if (tapCount > 500) { UnlockAchievement(TapTapRevolutionResources.achievement_you_are_30_awesome); } PlayerPrefs.SetInt("Best30", tapCount); gm.BestScoreLimited.text = "Best Score: " + PlayerPrefs.GetInt("Best30").ToString(); } break; case 60: if (tapCount > PlayerPrefs.GetInt("Best60")) { if (tapCount == 200) { UnlockAchievement(TapTapRevolutionResources.achievement_the_200_in_60); } else if (tapCount == 400) { UnlockAchievement(TapTapRevolutionResources.achievement_the_400_in_60); } else if (tapCount == 600) { UnlockAchievement(TapTapRevolutionResources.achievement_the_600_in_60); } else if (tapCount == 800) { UnlockAchievement(TapTapRevolutionResources.achievement_the_800_in_60); } else if (tapCount > 1000) { UnlockAchievement(TapTapRevolutionResources.achievement_you_are_60_awesome); } PlayerPrefs.SetInt("Best60", tapCount); gm.BestScoreLimited.text = "Best Score: " + PlayerPrefs.GetInt("Best60").ToString(); } break; } }
//set hat public void SetPlayerHat(int hat) { PlayerPrefs.SetInt("PlayerHat", hat); }
//set animal public void SetPlayerAnimal(int animal) { PlayerPrefs.SetInt("PlayerAnimal", animal); }
//set hair public void SetPlayerHair(int hair) { PlayerPrefs.SetInt("PlayerHair", hair); }
//set clothes public void SetPlayerClothes(int clothes) { PlayerPrefs.SetInt("PlayerClothes", clothes); }
//set mouth public void SetPlayerMouth(int mouth) { PlayerPrefs.SetInt("PlayerMouth", mouth); }
//set eyes public void SetPlayerEyes(int eyes) { PlayerPrefs.SetInt("PlayerEyes", eyes); }
//setting methods //set body public void SetPlayerBody(int body) { PlayerPrefs.SetInt("PlayerBody", body); }
void ClickLevel(int levelNumb) { PlayerPrefs.SetInt("CurrentLevel", levelNumb); SceneManager.LoadScene("LevelCentral"); }
public void AttackUpGrade() { int a = 0; float b = 0; switch (Singleton.getInstance.skill1lv) { case 0: a = 300; b = 1.5f; break; case 1: a = 600; b = 2; break; case 2: a = 1200; b = 4; break; case 3: a = 2400; b = 6; break; case 4: a = 4800; b = 9; break; case 5: b = 15; a = 999900; break; } if (Singleton.getInstance.money >= a) { Singleton.getInstance.money -= a; Singleton.getInstance.skill1lv++; switch (Singleton.getInstance.skill1lv) { case 0: a = 300; b = 1.5f; break; case 1: a = 600; b = 2; break; case 2: a = 1200; b = 4; break; case 3: a = 2400; b = 6; break; case 4: a = 4800; b = 9; break; case 5: b = 15; a = 999900; break; } needmoney_t.text = a.ToString() + "g"; upmoney_t.text = Singleton.getInstance.money.ToString() + " G"; power_t.text = b.ToString(); PlayerPrefs.SetInt("SKill1", Singleton.getInstance.skill1lv); PlayerPrefs.SetInt("Money", Singleton.getInstance.money); PlayerPrefs.SetInt("BerserkerLevel", Singleton.getInstance.Level); PlayerPrefs.Save(); } }
public void Save() { PlayerPrefs.SetInt("triesScore", triesScore + 1); }
// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody2D>(); PlayerPrefs.SetInt("Pontua", 0); }
public void QualityDown() { QualitySettings.DecreaseLevel(); qualityText.text = qualityTextPrefix + QualitySettings.names[QualitySettings.GetQualityLevel()]; PlayerPrefs.SetInt("Quality", QualitySettings.GetQualityLevel()); }
void LevelUp() { PlayerPrefs.SetInt(Constants.c_PlayerLevelSave, GetPlayerLevel() + 1); }
protected override void SetKey(string key, int value) { PlayerPrefs.SetInt(key, value); }
void LevelDown() { PlayerPrefs.SetInt(Constants.c_PlayerLevelSave, GetPlayerLevel() - 1); }
public void Start3DGame() { PlayerPrefs.SetInt("3dMode", 1); PlayerPrefs.SetInt("AppleCount", 10); SceneManager.LoadScene("Main"); }
public void OnApplicationQuit() { PlayerPrefs.SetInt("Player Score", 0); //Debug.Log("Reset score"); }
void OnDestroy() { PlayerPrefs.SetInt("coins", coin); PlayerPrefs.SetInt("highestScore", highscore); }
public void ClearHighScore() { PlayerPrefs.SetInt("highscore", 0); GetHighscore(); }
public void Remember() { PlayerPrefs.SetInt("fruits", consumed); }
public void GoToLeaderboardScene() { PlayerPrefs.SetInt("HighScore", HighScore); UpdateGPGLeaderboard(); SceneManager.SP.OpenScene(2); }
void FixedUpdate () { if (Input.GetKeyDown(KeyCode.L)) { q = 0; PlayerPrefs.SetInt("q", q); } //bool joyActiveR = Input.GetKey (KeyCode.RightArrow); //bool joyActiveL = Input.GetKey (KeyCode.LeftArrow); //Left Thumb Stick //bool joyActiveR = Input.GetAxis ("360_Joy") > .5; //bool joyActiveL = Input.GetAxis ("360_Joy") < -.5; //bool jetpackActive = Input.GetButton("Fire1"); //Right Thumb Stick if (Thumbstick) { bool joyActiveR = Input.GetAxis("360_JoyR") > .5; bool joyActiveL = Input.GetAxis("360_JoyR") < -.5; float joypR = Input.GetAxis("360_JoyR"); float joyRY = Input.GetAxis("360_JoyRY"); if (joyActiveR) { GetComponent<Rigidbody2D>().AddForce(new Vector2(speed, 0)); transform.rotation = Quaternion.identity; } if (joyActiveL) { GetComponent<Rigidbody2D>().AddForce(new Vector2(-speed, 0)); transform.rotation = Quaternion.identity; } //print(joyRY); } else { bool joyActiveR = Input.GetAxis("360_JoyL") > .5; bool joyActiveL = Input.GetAxis("360_JoyL") < -.5; float joypL = Input.GetAxis("360_JoyL"); if (joyActiveR) { GetComponent<Rigidbody2D>().AddForce(new Vector2(speed, 0)); transform.rotation = Quaternion.identity; } if (joyActiveL) { GetComponent<Rigidbody2D>().AddForce(new Vector2(-speed, 0)); transform.rotation = Quaternion.identity; } //print(joypL); } acceleration = (GetComponent<Rigidbody2D>().velocity.x - lastVelocity) / Time.fixedDeltaTime; lastVelocity = GetComponent<Rigidbody2D>().velocity.x; //print (lastVelocity); }
public static bool storeOnDisk(string key, int value) { PlayerPrefs.SetInt(key, value); //check if storage process had success return(PlayerPrefs.GetInt(key) == value); }