public void StarAnimSet() { //iTween.PunchScale (Stars,new Vector3 (2, 2, 0), 1); Stars.GetComponentInChildren <Text>().text = ZPlayerPrefs.GetInt(GameConstants.GLOBALSTARS_STRING, 0).ToString(); starPart.Play(); }
void Start() { // set false to see plain data //ZPlayerPrefs.useSecure = false; // txtStatus.text = "Initialize"; ZPlayerPrefs.Initialize("will", "12345678"); //txtStatus.text = "Set Value"; //Debug.Log("-------------------------"); // Debug.Log("Set Value"); SetPlayerPrefs(); // txtStatus.text = "Read Get Value First Time"; Debug.Log("-------------------------"); //Debug.Log("Read Get Value First Time"); GetPlayerPrefs(); // txtStatus.text = "Read Get Value Second Time"; // Debug.Log("-------------------------"); // Debug.Log("Read Get Value Second Time"); // GetPlayerPrefs(); txtStatus.text = "See the console for the result"; StartCoroutine(BlinkStatus()); //ZPlayerPrefs.DeleteAll (); }
// Use this for initialization void Start() { // Don't let screen turn off Screen.sleepTimeout = SleepTimeout.NeverSleep; boughtDoge = ZPlayerPrefs.GetInt("Bought Doge"); playerList = GameObject.FindGameObjectWithTag("Player List").GetComponent <PlayerList> (); highScore = PlayerPrefs.GetInt("HighScore"); Players.Clear(); for (int i = 0; i < CatList.Length; i++) { Players.Add(playerList.players[i]); } if (PlayerLocation == null) { PlayerLocation = transform; } foreach (GameObject cat in CatList) { cat.transform.position = PlayerLocation.position; cat.SetActive(false); } // Show selected cat ShowCat(ZPlayerPrefs.GetInt("PlayerNum")); }
private string AuthMethod = "dev"; //email // Use this for initialization void Start() { LoadingCanvas.enabled = false; DontDestroyOnLoad(localPlayerDataObject); ZPlayerPrefs.Initialize("spacequak132", "spacesaltysalt132"); LoginCanvas.enabled = false; RegisterCanvas.enabled = false; HaveAccountCanvas.enabled = false; RegisterEmailCanvas.enabled = false; CurrentCanvas = LoginCanvas; Email = ""; UserName = ""; Password = ""; LogoAnim.JumpToSmall(true); if (AutoLogin && !PlayerLogout()) { Email = ZPlayerPrefs.GetString("username"); Password = ZPlayerPrefs.GetString("passd"); LogoAnim.JumpToSmall(false); if ((Email.Length > 0) && (Password.Length > 0)) { LogIn(); } else { LogInWithDeviceID(false); } } else { ShowCanvas(HaveAccountCanvas); } }
// Use this for initialization void Start() { GameAnalytics.NewDesignEvent("CharacterShopOpened"); int starCount = ZPlayerPrefs.GetInt(GameConstants.GLOBALSTARS_STRING); starText.text = "" + starCount; }
void checkWinner() { if (NewGame.gameMode == 0) { if (enemyPoints >= 50 || Input.GetKeyDown(KeyCode.Escape)) { result.text = "YOU LOSE!"; returnMenu.text = "RETURN TO MENU"; playAgain.text = "PLAY AGAIN"; Time.timeScale = 0; } } else if (NewGame.gameMode == 1) { if (enemyPoints - PlayerScore.playerPoints > 20 || Input.GetKeyDown(KeyCode.Escape)) //10 points to win { result.text = "YOU LOSE!"; returnMenu.text = "RETURN TO MENU"; playAgain.text = "PLAY AGAIN"; Time.timeScale = 0; if (PlayerScore.playerPoints > ZPlayerPrefs.GetInt("High Score")) { ZPlayerPrefs.SetInt("High Score", PlayerScore.playerPoints); } } } }
public void UpdateBestText() { if (LoadedLevel == null) { return; } bool ranked = PlayerPrefsExt.GetBool(PreferenceKeys.RankedMode()); if (Math.Abs(ZPlayerPrefs.GetFloat( PreferenceKeys.BestScore(LoadedLevel, CytoidApplication.CurrentChartType, ranked), defaultValue: -1) - (-1)) < 0.000001) { bestText.text = "NO HIGH SCORE YET"; } else { bestText.text = (ranked ? "R score" : "Score") + " " + Mathf.CeilToInt(ZPlayerPrefs.GetFloat( PreferenceKeys.BestScore(LoadedLevel, CytoidApplication.CurrentChartType, ranked), 0)).ToString("D6") + " " + (ranked ? "R acc." : "Acc.") + " " + ZPlayerPrefs.GetFloat( PreferenceKeys.BestAccuracy(LoadedLevel, CytoidApplication.CurrentChartType, ranked), 0).ToString("0.##") + "%"; } }
public static bool RestoreOldPrefs() { if (ZPlayerPrefs.HasKey("prefs_")) { var restoredV1 = SaveGameMembers.FromJson(ZPlayerPrefs.GetString("prefs_")); if (restoredV1.BestScore > 0) { Members = restoredV1; Save(); return(true); } } if (PlayerPrefs.HasKey("prefs")) { var restoredV0 = SaveGameMembers.FromJson(ZPlayerPrefs.GetString("prefs")); if (restoredV0.BestScore > 0) { Members = restoredV0; Save(); return(true); } } return(false); }
public void CreatePlayerInfo(string playerName) { LocalDBController .DataService .Connection .DeleteAll <PlayerInfo>(); LocalDBController .DataService .Connection .DeleteAll <PlayPuzzles>(); LocalDBController .DataService .Connection .DeleteAll <UserPuzzle>(); LocalDBController .DataService .Connection .DeleteAll <Purchases>(); ZPlayerPrefs.DeleteAll(); LocalDBController .InsertOrReplace(new PlayerInfo { Name = playerName, }); }
void Start() { _ship._health = 5; ZPlayerPrefs.Initialize("agoodpassword", "whatisthislol"); diamondCount = ZPlayerPrefs.GetInt("Diamonds", 0); diffIncreaseText.SetActive(false); }
void Start() { // set false to see plain data //ZPlayerPrefs.useSecure = false; txtStatus.text = "Initialize"; ZPlayerPrefs.Initialize("what'sYourName", "salt12issalt"); txtStatus.text = "Set Value"; Debug.Log("-------------------------"); Debug.Log("Set Value"); SetPlayerPrefs(); txtStatus.text = "Read Get Value First Time"; Debug.Log("-------------------------"); Debug.Log("Read Get Value First Time"); GetPlayerPrefs(); txtStatus.text = "Read Get Value Second Time"; Debug.Log("-------------------------"); Debug.Log("Read Get Value Second Time"); GetPlayerPrefs(); txtStatus.text = "See the console for the result"; StartCoroutine(BlinkStatus()); }
public void UpdateMainInformation() { totalgems = ZPlayerPrefs.GetInt("totalgems"); highscore = ZPlayerPrefs.GetInt("highscore"); gemsInformation.text = totalgems.ToString(); highscoreInformation.text = highscore.ToString(); }
// Use this for initialization void Awake() { ZPlayerPrefs.Initialize("12345678", "pombobravogame"); estrelasVal = new int[2]; pontosVal = new int[2]; for (int a = 0; a < 2; a++) { for (int x = 0; x <= ZPlayerPrefs.GetInt("FasesNumMestra" + (a + 1)); x++) { estrelasVal [a] += ZPlayerPrefs.GetInt("Level" + x + "_Mestra" + (a + 1) + "estrelas"); ZPlayerPrefs.SetInt("Mestra" + (a + 1) + "Star", estrelasVal [a]); pontosVal [a] += ZPlayerPrefs.GetInt("Level" + x + "_Mestra" + (a + 1) + "bestMestra" + (a + 1)); ZPlayerPrefs.SetInt("Mestra" + (a + 1) + "p", pontosVal [a]); } } estrelas = GameObject.FindWithTag("textstar").GetComponent <TextMeshProUGUI> (); estrelas2 = GameObject.FindWithTag("textstar2").GetComponent <TextMeshProUGUI> (); estrelas.SetText(ZPlayerPrefs.GetInt("Mestra1Star").ToString()); estrelas2.SetText(ZPlayerPrefs.GetInt("Mestra2Star").ToString()); pontos = GameObject.FindWithTag("textPontos").GetComponent <TextMeshProUGUI> (); pontos2 = GameObject.FindWithTag("textPontos2").GetComponent <TextMeshProUGUI> (); pontos.SetText(ZPlayerPrefs.GetInt("Mestra1p").ToString()); pontos2.SetText(ZPlayerPrefs.GetInt("Mestra2p").ToString()); }
// Use this for initialization void Start() { // PlayerPrefs.DeleteAll(); // PlayerPrefs.Save(); fader.SetActive(false); bestScoreInt = ZPlayerPrefs.GetInt(GameConstants.BESTSCORE_STRING, 0); BestScore.GetComponent <Text>().text = bestScoreInt.ToString(); currentScoreInt = ZPlayerPrefs.GetInt(GameConstants.CURRENTSCORE_STRING, 0); CurrentScore.GetComponent <Text>().text = currentScoreInt.ToString(); Stars.GetComponentInChildren <Text>().text = ZPlayerPrefs.GetInt(GameConstants.GLOBALSTARS_STRING, 0).ToString(); showRatePanel(); InvokeRepeating("ActivateVideoAdBtn", 1f, 2f); if (AudioListener.volume == 0.0f) { Sprite temp = Resources.Load("sound_off", typeof(Sprite)) as Sprite; musicOn.GetComponent <Image>().overrideSprite = temp; //Resources.Load ("DressingScene/Body/body"+id.ToString()+".png",typeof(Sprite)) as Sprite; //musicOn.GetComponent<UISprite>().spriteName = "SoundOn-button"; } else { Sprite temp = Resources.Load("sound_on", typeof(Sprite)) as Sprite; musicOn.GetComponent <Image>().overrideSprite = temp; //musicOn.GetComponent<UISprite>().spriteName = "SoundOff-button"; } }
void Start() { // Z-Player prefs ZPlayerPrefs.Initialize("sqPrefEncrypt29845", "09164667352sss"); // Initialize other scripts O_Globals.I._start(); O_Inputs.I._start(); O_ControlScene.I._start(); // Variables prof = ZPlayerPrefs.GetInt("Profile"); // Create the map if (PlayerPrefs.GetInt("FirstMap") == 1) { O_DB_Maps.I._createMap(ZPlayerPrefs.GetString("LastMap_" + prof.ToString())); } else { O_DB_Maps.I._createMap(PlayerPrefs.GetString("NextMap")); } // Create the black borders _createBorders(); // Initialize controllers O_ControlHero.I._start(); // Also spawns the hero }
public void Revive() { revivePurchased = true; if (reviveCheck) { if (ZPlayerPrefs.GetInt("BananaCountPref") > 500 || ZPlayerPrefs.GetInt("BananaCountPref") == 500) { ReviveBIGBOX.SetActive(true); Monkey.instance.ShieldStart(); reviveButton.SetActive(false); reviveBool = true; Monkey.instance.curHealth = Monkey.instance.maxHealth; AestheticGameObject.SetActive(true); DarkPanel.SetActive(false); gameOverPanel.SetActive(false); gameOver = false; FindObjectOfType <AudioManager>().Play("InGame"); gameOverCheck = true; Time.timeScale = 1f; reviveCheck = false; Monkey.instance.paused = false; } else { gameOverPanel.SetActive(false); UiManager.instance.ShowBananaWarning(); } } }
void checkWinner() { if (NewGame.gameMode == 0) { if (playerPoints >= 50) { result.text = "YOU WIN!"; returnMenu.text = "RETURN TO MENU"; playAgain.text = "PLAY AGAIN"; Time.timeScale = 0; if (redBallHit == false) { ZPlayerPrefs.SetInt("Seeing Red", 1); } } } else if (NewGame.gameMode == 1) { if (EnemyScore.enemyPoints - playerPoints > 20 || Input.GetKeyDown(KeyCode.Escape)) //10 points to win { result.text = "YOU LOSE!"; returnMenu.text = "RETURN TO MENU"; playAgain.text = "PLAY AGAIN"; Time.timeScale = 0; if (playerPoints > ZPlayerPrefs.GetInt("High Score")) { ZPlayerPrefs.SetInt("High Score", playerPoints); } } } }
// Update is called once per frame private void Update() { if (spawning == false && Time.time >= 4 && wave == 0) { StartCoroutine("spawnWaves"); } if (spawning == false && Time.time >= timeSinceSpawn + timeBetweenWaves && wave != 0) { StartCoroutine("spawnWaves"); } if (wave == totalWaves && GameObject.FindGameObjectsWithTag("enemy").Length == 0) { int currentLevel = 0; int.TryParse(GameMaster._instance_.levelSelected, out currentLevel); if (currentLevel > 0) { if (GameMaster._instance_.maxLevel > currentLevel && GameMaster._instance_.levelsAvailable.Count < GameMaster._instance_.maxLevel) { GameMaster._instance_.levelsAvailable.Add(currentLevel + 1); ZPlayerPrefs.SetInt("LevelsUnlocked", GameMaster._instance_.levelsAvailable.Count); } } SceneManager.LoadScene("levelCleared"); } }
public void NEXTLEVEL() { ZPlayerPrefs.Initialize("what'sYourName", "salt12issalt"); ZPlayerPrefs.SetFloat("Speed", currentSpeed); ZPlayerPrefs.Save(); Application.LoadLevel(2); }
public void ShowLastPlayedPuzzle() { int lastPuzzleID = ZPlayerPrefs.GetInt("LastPlayedPuzzle"); if (lastPuzzleID == 0) { FollowMachine.SetOutput("No Last Puzzle"); return; } Puzzle puzzle = LocalDBController.Table <Puzzle>(). SqlWhere(p => p.ID == lastPuzzleID). FirstOrDefault(); int?categoryID = puzzle?.CategoryID; if (categoryID != null) { int id = categoryID.Value; Category category = LocalDBController. Table <Category>(). SqlWhere(c => c.ID == id). FirstOrDefault(); Debug.Log(category.ID); PuzzleList.CategoryWindow.Select(category); FollowMachine.SetOutput("Play"); return; } FollowMachine.SetOutput("No Last Puzzle"); }
public void OnLevelLoaded() { switchDifficultyView.OnLevelLoaded(); CytoidApplication.CurrentLevel = LoadedLevel; UpdateBestText(); var useLocalOptions = ZPlayerPrefs.GetBool(PreferenceKeys.WillOverrideOptions(CytoidApplication.CurrentLevel), false); overrideOptionsToggle.isOn = useLocalOptions; if (useLocalOptions) { localIsInversedToggle.isOn = ZPlayerPrefs.GetBool(PreferenceKeys.WillInverse(CytoidApplication.CurrentLevel), false); localUserOffsetInput.text = ZPlayerPrefs.GetFloat(PreferenceKeys.NoteDelay(CytoidApplication.CurrentLevel), PlayerPrefs.GetFloat("user_offset")).ToString(); } else { localIsInversedToggle.isOn = isInversedToggle.isOn; localUserOffsetInput.text = userOffsetInput.text; } // confirmText.text = "Are you sure you want to delete\n" + LoadedLevel.id + "?"; deleteButton.SetActive(!LoadedLevel.is_internal); PlayerPrefs.SetString("last_level", LoadedLevel.id); }
void Start() { // set false to see plain data //ZPlayerPrefs.useSecure = false; txtStatus.text = "Initialize"; ZPlayerPrefs.Initialize("lukas0842", "43FT423FF343FWDEF4332DDE"); txtStatus.text = "Set Value"; Debug.Log("-------------------------"); Debug.Log("Set Value"); SetPlayerPrefs(); txtStatus.text = "Read Get Value First Time"; Debug.Log("-------------------------"); Debug.Log("Read Get Value First Time"); GetPlayerPrefs(); txtStatus.text = "Read Get Value Second Time"; Debug.Log("-------------------------"); Debug.Log("Read Get Value Second Time"); GetPlayerPrefs(); txtStatus.text = "See the console for the result"; StartCoroutine(BlinkStatus()); }
private bool canUseFreeSave() { DateTime lastUse = DateTime.Now; if (ZPlayerPrefs.HasKey("freeSysString")) { string lastUseString = ZPlayerPrefs.GetString("freeSysString"); lastUse = DateTime.Parse(lastUseString); var currentTime = DateTime.Now.Ticks; var currentTimess = DateTime.Now; var limitTime = lastUse.AddMinutes(15d).Ticks; if (limitTime < currentTime) { return(true); } else { return(false); } } else { return(true); } }
public void subStars(int newStars) { int currStars = ZPlayerPrefs.GetInt(GameConstants.GLOBALSTARS_STRING); int finalStars = currStars - newStars; ZPlayerPrefs.SetInt(GameConstants.GLOBALSTARS_STRING, finalStars); }
// Use this for initialization void Start() { Sound sound = Sound.Instance; sound.play(sound.StartGame); sound.startPlayMusic(); DungeonSize = ZPlayerPrefs.GetInt("sp_DungeonSize"); if (DungeonSize == 1) { DungeonSize = smallSize; } else if (DungeonSize == 2) { DungeonSize = mediumSize; } else if (DungeonSize == 3) { DungeonSize = largeSize; } amountOfPossibleRooms = spawnPrefabs.Length; //init spawn spawnRoom = Instantiate(startingPrefab, Vector3.zero, Quaternion.Euler(new Vector3(0, 45, 0))) as GameObject; spawnRoom.transform.parent = dungeonParent.transform; StartCoroutine(spawnNextRoom()); }
protected override void Awake() { base.Awake(); if (Cache == null) { Cache = new MemoryCache(); } Cache.Handler = new SimpleDownloadHandler(); Cache.UrlLocator = new SimpleUrlLocator(); Cache.CacheLocator = new SimpleCacheLocator(); if (GameObject.FindGameObjectsWithTag("ApplicationObject").Length > 1) { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); Screen.sleepTimeout = SleepTimeout.NeverSleep; Application.targetFrameRate = 120; ZPlayerPrefs.Initialize(SecuredConstants.password, SecuredConstants.salt); UseDoozyUi = Type.GetType("DoozyUI.UIElement") != null; OriginalWidth = Screen.width; OriginalHeight = Screen.height; }
public void SelectCat() { menuC.PlayOneShot(menuClick); ZPlayerPrefs.SetString("Player", Players[catNum].catName); ZPlayerPrefs.SetInt("PlayerNum", catNum); StartCoroutine(LoadCat()); }
// Use this for initialization void Start() { blackBG.SetActive(false); versionText.text = "Version " + Application.version; // Enable the GUI animator ui panel infoPanel.SetActive(true); exitPanel.SetActive(true); activatePanel.gameObject.SetActive(true); settingPanel.transform.DOScale(0, 0); // Check to show start menu or main menu. if (PlayerPrefs.GetInt("START_MENU", 1) == 1) { startPanel.SetActive(true); menuPanel.SetActive(false); loadingPanel.SetActive(false); infoPanel.SetActive(false); StartCoroutine(StartAnimate()); } else { ShowMainMenu(); PlayerPrefs.SetInt("START_MENU", 1); } ZPlayerPrefs.Initialize("360Ed@R0cK", "AlphabetAR"); }
void firstStart() { ZPlayerPrefs.SetInt("soundon", 1); ZPlayerPrefs.SetInt("musicon", 1); ZPlayerPrefs.SetInt("framerate", 60); Application.targetFrameRate = ZPlayerPrefs.GetInt("framerate"); money = 0; keys = 0; level = 1; craftlevel = 1; exp = 0; damage = 0; armor = 0; lifesteal = 0.00f; crit = 0.00f; loot = 1.00f; mspeed = 1.00f; ZPlayerPrefs.SetString("SaveString", ""); ZPlayerPrefs.SetInt("noAds", 1); playerName = SystemInfo.deviceName; Debug.Log(SystemInfo.deviceName); for (int i = 0; i < inventory.Length; i++) { inventory[i] = 0; } giveDefaultItems(); save(); loadPlayerData(); loadEquippedItemsArray(); updateStats(); }
//! Get JSON for User IEnumerator GetUser(bool all) { UnityWebRequest uwr = UnityWebRequest.Get(Server.Address("read_user") + ZPlayerPrefs.GetString("id")); uwr.timeout = 10; yield return(uwr.SendWebRequest()); if (uwr.isNetworkError) { Debug.Log("Error While Sending: " + uwr.error); NPBinding.UI.ShowToast("Communication Error. Please try again later.", eToastMessageLength.SHORT); } else { if (User.CreateUserFromJSON(uwr.downloadHandler.text).GetID() == "") { yield break; } UpdateSessions.JSON_Session("user", uwr.downloadHandler.text); if (all) { yield return(StartCoroutine(GetPlayer())); } } uwr.Dispose(); StopCoroutine(GetUser(all)); }