// Use this for initialization void Start() { StartCoroutine(hyperspeed()); gc = GameObject.Find("GameCenter MNGR"); animator = GetComponent <Animator> (); goingRight = true; hit = false; paused = false; toggle = PlayerPrefsX.GetBool("toggle"); vibrate = PlayerPrefsX.GetBool("vibrate"); isAlive = true; playCount++; totalDeaths = PlayerPrefs.GetInt("totalDeaths"); GetComponent <AudioSource> ().volume = .5f; scoreScript = GameObject.Find("Text").GetComponent <Score> (); if (Application.loadedLevel == 2 || Application.loadedLevel == 3 || Application.loadedLevel == 4 || Application.loadedLevel == 17 || Application.loadedLevel == 18 || Application.loadedLevel == 19) { GameObject cam = GameObject.Find("GoingUp"); transform.parent = cam.transform; } }
public bool CheckIsAchievementUnlockedAtIndex(int index) { bool result = false; result = PlayerPrefsX.GetBool(sAchievementID [index]); return(result); }
private void Update() { // Don't move while paused if (GameObject.Find("PauseMenu") != null) { return; } if (Hexagon.busyFlipping == 0) { if (gameOver) { gameOverMenu.SetActive(true); } else { if (player1Turn && PlayerPrefsX.GetBool("player1IsAI") && framesSincemove >= 20) { aiComponent.MakeMove(1, PlayerPrefs.GetInt("player1AILevel")); } if (!player1Turn && PlayerPrefsX.GetBool("player2IsAI") && framesSincemove >= 20) { aiComponent.MakeMove(-1, PlayerPrefs.GetInt("player2AILevel")); } } } framesSincemove++; }
void Update() { if (!PlayerPrefsX.GetBool("Sound")) { if (!backgroundSource.mute) { backgroundSource.mute = true; } if (!effectSource.mute) { effectSource.mute = true; } if (!coinSource.mute) { coinSource.mute = true; } } else if (PlayerPrefsX.GetBool("Sound")) { if (backgroundSource.mute) { backgroundSource.mute = false; } if (effectSource.mute) { effectSource.mute = false; } if (!coinSource.mute) { coinSource.mute = false; } } }
// Use this for initialization void Awake() { //PlayerPrefs.DeleteKey ("collectVal"); //used to reset PlayerPrefs after tests name = gameObject.name; isCollected = PlayerPrefsX.GetBool("collected"); //colMan = GameObject.Find ("CollectibleManager").GetComponent<CollectibleManager>(); }
void OnEnable() { PlayerGridObject p = FindObjectOfType <PlayerGridObject>(); //makes sure we have an animator if (!animator) { animator = this.gameObject.GetComponent <Animator>(); } x = this.gameObject.transform.position.x; y = this.gameObject.transform.position.y; z = this.gameObject.transform.position.z; opened = PlayerPrefsX.GetBool("scene" + Application.loadedLevel + "loadedSlot" + Globals.loadedSlot + "pos x" + x + "pos y" + y + "pos z" + z + "door"); if (opened) { OpenDoor(); } else { CloseDoor(); } }
void Awake() { carController = GetComponent <RCC_CarControllerV3>(); defMaxSpeed = carController.maxspeed; defHandling = carController.highwaySteeringHelper; defMaxBrake = carController.highwayBrakingHelper; if (PlayerPrefs.HasKey(transform.name + "SelectedWheel")) { wheelIndex = PlayerPrefs.GetInt(transform.name + "SelectedWheel", 0); selectedWheel = HR_Wheels.Instance.wheels[wheelIndex].wheel; } else { selectedWheel = null; } _speedLevel = PlayerPrefs.GetInt(transform.name + "SpeedLevel"); _handlingLevel = PlayerPrefs.GetInt(transform.name + "HandlingLevel"); _brakeLevel = PlayerPrefs.GetInt(transform.name + "BrakeLevel"); bodyColor = PlayerPrefsX.GetColor(transform.name + "BodyColor", HR_HighwayRacerProperties.Instance._defaultBodyColor); isSirenPurchased = PlayerPrefsX.GetBool(transform.name + "Siren", false); isSirenAttached = PlayerPrefsX.GetBool(transform.name + "SirenAttached", false); isNOSPurchased = PlayerPrefsX.GetBool(transform.name + "NOS", false); isTurboPurchased = PlayerPrefsX.GetBool(transform.name + "Turbo", false); }
private void Awake() { SelectedMapIndex = PlayerPrefs.GetInt("SelectedMapIndex", 0); NumberOfPlayers = PlayerPrefs.GetInt("NumberOfPlayers", 2); NumberOfCharactersPerPlayer = PlayerPrefs.GetInt("NumberOfCharactersPerPlayer", 1); IsMuted = PlayerPrefsX.GetBool("IsMuted", false); }
private void Start() { _on = PlayerPrefsX.GetBool("localServerON", false); if (!_on) { return; } _protocol = PlayerPrefs.GetString("protocol", "UDP"); _ip = PlayerPrefs.GetString("localServerIP", "127.0.0.1"); _port = PlayerPrefs.GetInt("localServerPORT", 5000); ThreadStart ts; if (_protocol == "TCP") { ts = ListenTcp; _tcpListener = new TcpListener(IPAddress.Parse(_ip), _port); _tcpClient = new TcpClient(); } else { ts = ListenUdp; _udpClient = new UdpClient(_port); } _listenThread = new Thread(ts); _listenThread.Start(); }
// Update is called once per frame void Update() { redFireL = PlayerPrefsX.GetBool("redFireL"); blueFireL = PlayerPrefsX.GetBool("blueFireL"); yellowFireL = PlayerPrefsX.GetBool("yellowFireL"); greenFireL = PlayerPrefsX.GetBool("greenFireL"); pinkFireL = PlayerPrefsX.GetBool("pinkFireL"); redShipL = PlayerPrefsX.GetBool("redShipL"); blueShipL = PlayerPrefsX.GetBool("blueShipL"); yellowShipL = PlayerPrefsX.GetBool("yellowShipL"); greenShipL = PlayerPrefsX.GetBool("greenShipL"); pinkShipL = PlayerPrefsX.GetBool("pinkShipL"); if (redShipL == true) { redShip.GetComponent <Toggle>().enabled = false; } else { redShip.GetComponent <Toggle>().enabled = true; } if (blueShipL == true) { blueShip.GetComponent <Toggle>().enabled = false; } else { blueShip.GetComponent <Toggle>().enabled = true; } if (yellowShipL == true) { yellowShip.GetComponent <Toggle>().enabled = false; } else { yellowShip.GetComponent <Toggle>().enabled = true; } if (greenShipL == true) { greenShip.GetComponent <Toggle>().enabled = false; } else { greenShip.GetComponent <Toggle>().enabled = true; } if (pinkShipL == true) { pinkShip.GetComponent <Toggle>().enabled = false; } else { pinkShip.GetComponent <Toggle>().enabled = true; } }
public static int LoadTheGame(int loadSlot) //should be 1-4 { //check if load exists, if not doesn't load the game if (PlayerPrefsX.GetVector3("respawn" + loadSlot) == null) { return(-1); //failure } plants.Clear(); loadedSlot = loadSlot; //LOADS THE GAME SceneManager.LoadScene(PlayerPrefs.GetString("activeScene" + loadSlot)); //change update player next respawn spawnLocation = PlayerPrefsX.GetVector3("respawn" + loadSlot); Globals.player.health = PlayerPrefs.GetInt("playerHealth" + loadSlot); inventory = PlayerPrefsX.GetIntArray("playerInventory" + loadSlot); print(inventory); PlayerPrefsX.GetBool("lavaBossBeaten" + loadSlot, lavaBossBeaten); PlayerPrefsX.GetBool("windBossBeaten" + loadSlot, windBossBeaten); PlayerPrefsX.GetBool("caveBossBeaten" + loadSlot, caveBossBeaten); Vector3[] tempPlantPositions = PlayerPrefsX.GetVector3Array("PlantPositions" + loadSlot); int[] tempPlantTypes = PlayerPrefsX.GetIntArray("PlantTypes" + loadSlot); String[] tempPlantScenes = PlayerPrefsX.GetStringArray("PlantScenes" + loadSlot); int[] tempPlantDirections = PlayerPrefsX.GetIntArray("PlantDirections" + loadSlot); for (int i = 0; i < tempPlantDirections.Length; i++) { plants.Add(new PlantData(tempPlantPositions[i], tempPlantScenes[i], (Direction)tempPlantDirections[i]), tempPlantTypes[i]); } return(1); //success }
public void loadLocation() { bool isSaved = PlayerPrefsX.GetBool(name + "saved"); if (!isSaved) { Debug.Log(name + " no Saved preferences", gameObject); return; } SetHorizontalPivot(AnchorModes.min); SetVerticalPivot(AnchorModes.max); if (PlayerPrefsX.GetBool(name + "horiz")) { SetHorizontalPivot(AnchorModes.max); } else { SetHorizontalPivot(AnchorModes.min); } if (PlayerPrefsX.GetBool(name + "vert")) { SetVerticalPivot(AnchorModes.max); } else { SetHorizontalPivot(AnchorModes.min); } SetDimensions(PlayerPrefsX.GetVector3(name + "size")); rect.position = PlayerPrefsX.GetVector3(name + "position"); rect.localScale = PlayerPrefsX.GetVector3(name + "scale"); Debug.Log(name + " loaded ", gameObject); }
void OnCollisionEnter(Collision collision) { if (collision.transform.tag == "stand") { Vector3 _position = playerParent.transform.position; _position.z = collision.transform.position.z; playerParent.transform.position = _position; parent_curPos = playerParent.transform.position; rb.velocity = new Vector3(0, speed, 0); if (ReferenceEquals(collision.transform, GameController.instance.allStands [1])) { GameController.instance.AddScore(scoreValue); if (!PlayerPrefsX.GetBool(GameKeys.kPrefSoundOn)) { audio_Source.PlayOneShot(jump_Sound, 1.0f); } Destroy(GameController.instance.allStands [0].gameObject); GameController.instance.allStands.Remove(GameController.instance.allStands [0]); GameController.instance.AddStand(); } } }
void configureBackgroundMusic() { if (PlayerPrefsX.GetBool("Background_Music_Toggle") && !GameObject.Find("BackgroundMusic(Clone)")) { backgroundMusicObject = Instantiate(backgroundMusic, Vector3.zero, Quaternion.identity); } }
void Start() { setUpHelpPanel(); // for testing // PlayerPrefs.DeleteAll(); leftHandMode = PlayerPrefsX.GetBool("Left_Handle_Toggle", false); if (leftHandMode) { deck.transform.localPosition = new Vector2(-deck.transform.localPosition.x, 0); leftHandedHelpArrowLeft.SetActive(true); leftHandedHelpArrowRight.SetActive(false); } else { leftHandedHelpArrowLeft.SetActive(false); leftHandedHelpArrowRight.SetActive(true); } string path = readJsonData(gameLevel); questionData = JsonMapper.ToObject(File.ReadAllText(path)); loadQuestions(); instantiateRandomQuestionToDisplay(); configureBackgroundMusic(); strtTime = Time.time; }
// setting up the help panel to display when it is a first time play void setUpHelpPanel() { switch (mode.text) { case "Standard": if (PlayerPrefsX.GetBool("First_Time_Level_Two_Standard", true)) { toggleHelpPanel(); PlayerPrefsX.SetBool("First_Time_Level_Two_Standard", false); } break; case "Time Trial": if (PlayerPrefsX.GetBool("First_Time_Level_Two_Trial", true)) { toggleHelpPanel(); PlayerPrefsX.SetBool("First_Time_Level_Two_Trial", false); } break; case "Extreme": if (PlayerPrefsX.GetBool("First_Time_Level_Two_Extreme", true)) { toggleHelpPanel(); PlayerPrefsX.SetBool("First_Time_Level_Two_Extreme", false); } break; default: break; } }
// Use this for initialization void Start() { LeverAnimator = GetComponent <Animator>(); if (PlayerPrefsX.GetBool("LeverLoading")) { if (gameObject.name == "LeftLever") { LeverAnimator.SetBool("Pulled", PlayerPrefsX.GetBool("LeftLeverPulled")); PlayerPrefsX.SetBool("LeftLeverDealtWith", true); } if (gameObject.name == "RightLever") { LeverAnimator.SetBool("Pulled", PlayerPrefsX.GetBool("RightLeverPulled")); PlayerPrefsX.SetBool("RightLeverDealtWith", true); } if (PlayerPrefsX.GetBool("LeftLeverDealtWith") && PlayerPrefsX.GetBool("RightLeverDealtWith")) { PlayerPrefsX.SetBool("LeverLoading", false); //this line is what is causing the issues with the left lever PlayerPrefsX.SetBool("LeftLeverDealtWith", false); PlayerPrefsX.SetBool("RightLeverDealtWith", false); } } }
public void Next(string x) { Debug.Log("im here:" + scene.name); if (scene.name.Equals("Level24Scene1MOD") && PlayerPrefs.HasKey("isFinished" + scene.name)) { SceneManager.LoadScene("LevelFinishMOD"); } else { if (!PlayerPrefs.HasKey("isFinished" + scene.name)) { Debug.Log("no playerprefs"); SceneManager.LoadScene("Map 1"); } else { if (PlayerPrefsX.GetBool("isFinished" + scene.name)) { Debug.Log("has playerprefs"); SceneManager.LoadScene(x); } else { Debug.Log("no playerprefs-inner"); SceneManager.LoadScene("Map 1"); } } } }
public void Update() { timer += Time.deltaTime; if (timer >= 4) { timer = 0; if (!isBannerLoaded) { // Debug.LogError("You forget to add IAP conditon for banner"); /// HHH // if(IAP conditon) if (!PlayerPrefsX.GetBool(GameKeys.kprefIsAdRemoved)) { RequestBanner(); } } if (!HasRewardVideoAD() && !isRewardVideoPlaying) { RequestRewardBasedVideo(); } if (!HasInterstitialAD()) { RequestInterstitial(); } } if (callbackRewarVideoComplete) { callbackRewarVideoComplete = false; if (OnDidCloseRewardVideoSuccess != null) { OnDidCloseRewardVideoSuccess(isRewardVideoComplete); } } }
public static void Vibrate() { if (PlayerPrefsX.GetBool("VibrateToggle", true)) { Handheld.Vibrate(); } }
// Use this for initialization void Start() { string[] array = PlayerPrefsX.GetStringArray("highscore"); toggle.enabled = PlayerPrefsX.GetBool("sendOnServer"); List <Score> seznam = new List <Score>(); for (int i = 0; i < array.Length; i++) { string[] deli = array[i].Split('|'); Score s = new Score(); s.name = deli[0]; s.points = Int32.Parse(deli[1]); seznam.Add(s); } List <Score> SortedList = seznam.OrderByDescending(o => o.points).ToList(); for (int i = 0; i < SortedList.Count && i < 5; i++) { text.text += (i + 1).ToString() + ". " + SortedList[i].name + "\n"; text2.text += SortedList[i].points.ToString() + "\n"; } }
void Awake() { myTransform = this.transform; myTransform.localScale = Vector3.zero; GetCoin = myTransform.GetComponent <AudioSource>(); GetCoin.mute = PlayerPrefsX.GetBool("Mute"); }
public void restore() { slot = GetComponent <Slot>(); if (persistant) { slot.log("restoring slot settings"); credits = PlayerPrefs.GetInt(slot.name + "_credits", credits); betPerLineIndex = PlayerPrefs.GetInt(slot.name + "_betPerLineIndex", betPerLineIndex); betPerLine = slot.betsPerLine[betPerLineIndex].value; //PlayerPrefs.GetInt(slot.name + "_betPerLine", betPerLine); linesPlayed = PlayerPrefs.GetInt(slot.name + "_linesPlayed", linesPlayed); for (int index = 0; index < slot.betsPerLine.Count; index++) { slot.betsPerLine[index].canBet = PlayerPrefsX.GetBool(slot.name + "_betsPerLine" + index, slot.betsPerLine[index].canBet); } if (linesPlayed > slot.lines.Count) { linesPlayed = slot.lines.Count; } //if (betPerLine > maxBetPerLine) betPerLine = maxBetPerLine; } else { if (betPerLineDefaultIndex > slot.betsPerLine.Count) { slot.logConfigError("Your machine default bet per line index is greater than the actual bets per line"); return; } betPerLine = slot.betsPerLine[betPerLineDefaultIndex].value; betPerLineIndex = betPerLineDefaultIndex; } }
public static void LoadAll() //Apenas carrega os parâmetros que copõem um player do disco, se player name não for nulo. { if (PlayerPrefs.HasKey("PLAYERLEVEL")) { playerLoad = new BasePlayer(); GameInformation.Aila = playerLoad; GameInformation.Aila.PlayerLevel = PlayerPrefs.GetInt("PLAYERLEVEL"); GameInformation.Aila.PlayerName = PlayerPrefs.GetString("PLAYERNAME"); GameInformation.Aila.Imaginacao = PlayerPrefs.GetInt("IMAGINACAO"); GameInformation.Aila.Determinacao = PlayerPrefs.GetInt("DETERMINACAO"); GameInformation.Aila.Armadura = PlayerPrefs.GetInt("ARMADURA"); GameInformation.Aila.Sorte = PlayerPrefs.GetInt("SORTE"); GameInformation.AilaPV = PlayerPrefs.GetInt("PVTOTAL"); GameInformation.AilaPVatual = PlayerPrefs.GetInt("PVATUAL"); GameInformation.AilaPF = PlayerPrefs.GetInt("PFTOTAL"); GameInformation.AilaPFatual = PlayerPrefs.GetInt("PFATUAL"); GameInformation.FragmentosDeMemoria = PlayerPrefs.GetInt("FRAGMENTOSDEMEMORIA"); GameInformation.LastScene = PlayerPrefs.GetString("LASTSCENE"); GameInformation.LastPos = PlayerPrefsX.GetVector3("SavePlayerPos"); GameInformation.coxinhabossWon = PlayerPrefsX.GetBool("COXINHABOSSDEFEATED"); List <BaseAction> AcoesSave = new List <BaseAction>(); //Estamos carregando uma lista específica manualmente por enquanto AcoesSave.Add(new AttackAction()); AcoesSave.Add(new Shove()); AcoesSave.Add(new Pat()); AcoesSave.Add(new ToqueChocante()); GameInformation.AcoesAprendidas = AcoesSave; } }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } myMusic = GetComponent <AudioSource>(); myMusic.mute = PlayerPrefsX.GetBool("Mute"); DontDestroyOnLoad(this.gameObject); int tOldIndex = IngameMusicIndex; IngameMusicIndex = Random.Range(0, IngameMusic.Length); if (IngameMusic.Length > 1) { while (IngameMusicIndex == tOldIndex) { IngameMusicIndex = Random.Range(0, IngameMusic.Length); } } else { myMusic.loop = true; } }
void LoadValues() { //turnAllToPrefabs (); string gameDataString = PlayerPrefs.GetString("GameData", "ERROR"); bool isOnGame = false; isOnGame = PlayerPrefsX.GetBool("OnGame", false); Debug.Log("IS ON GAME IS " + isOnGame); if (isOnGame) { string JSONS = PlayerPrefs.GetString("GameData", "ERROR98989898989898123"); if (JSONS.Contains("ERROR98989898989898123")) { isOnGame = false; } else { Common.playerInformation.playerNumber = PlayerPrefs.GetInt("PlayerNumber", Common.playerInformation.playerNumber); if (!Common.roundInformation.initializeTestData && Common.roundInformation.useTestDataAsGameData == false) { Common.roundInformation.gameData = Common.roundInformation.GetGameDataFromString(JSONS); Common.playerInformation.myID = Common.roundInformation.gameData.playerIDS[Common.playerInformation.playerNumber]; } Common.playerInformation.isOnGame = isOnGame; // Common.playerInformation.picChosen=PlayerPrefsX.GetBool("PicChosen", Common.playerInformation.picChosen); Common.playerInformation.myCloudImagePath = PlayerPrefs.GetString("ImageURL", Common.playerInformation.myCloudImagePath); Common.playerInformation.myLocalImagePath = PlayerPrefs.GetString("PickedImageLocalPath", Common.playerInformation.myCloudImagePath); Common.playerInformation.ready = PlayerPrefsX.GetBool("Ready", Common.playerInformation.ready); // Common.playerInformation.myID = Common.roundInformation.gameData.playerIDS[Common.playerInformation.playerNumber]; Common.gameLoader.LoadGamePasedOnSavedData(); } } }
// Use this for initialization private void Start() { //tcp _receiverIp.text = PlayerPrefs.GetString("receiverIP", ""); CheckReceiverIp(); _receiverPort.text = PlayerPrefs.GetInt("receiverPORT", 0).ToString(); CheckReceiverPort(); //server _localServerOn = PlayerPrefsX.GetBool("localServerON", _localServerToggle.isOn); if (_localServerOn != _localServerToggle.isOn) { _localServerToggle.isOn = _localServerOn; ToggleLocalServer(); } _localServerIp.interactable = _localServerPort.interactable = _localServerToggle.isOn; _localServerIp.text = PlayerPrefs.GetString("localServerIP", ""); CheckLocalServer(); _localServerPort.text = PlayerPrefs.GetInt("localServerPORT", 0).ToString(); CheckLocalServerPort(); SetButton(); }
private void Awake() { if (PlayerPrefsX.GetBool("DandelionsWeeded") == true) { gameObject.SetActive(false); } }
//TODO : Seperate entrance and character public void GenerateEntrance() { for (int i = 0; i < 1; i++) { Vector2 entrance = GetEntranceCoordination(); //Debug.Log((int)mapSize.x + ", " + (int)mapSize.y); //Debug.Log(x + ",, " + y); if (fieldEventFlag[(int)entrance.x, (int)entrance.y] == 0) { Vector3 eventPosition = new Vector3( -2.5f + (int)entrance.x * (5 / (mapSize.x - 1)) + (-(int)entrance.x + mapSize.x / 2) * -(mapSize.x - 6) / 15, 0.15f, -2.5f + (int)entrance.y * (5 / (mapSize.y - 1)) + (-(int)entrance.y + mapSize.y / 2) * -(mapSize.y - 6) / 15 ); Transform newTile = Instantiate(fieldEntrance, eventPosition, Quaternion.Euler(Vector3.right * 0)) as Transform; //newTile.localScale = Vector3.one * 0.3f; if (!PlayerPrefsX.GetBool(PrefsEntity.SaveFlag)) // Not saved : Entrance = Start Position { PlayerPrefs.SetInt(PrefsEntity.StartX, (int)entrance.x); PlayerPrefs.SetInt(PrefsEntity.StartY, (int)entrance.y); PlayerPrefs.SetInt(PrefsEntity.CurrentX, (int)entrance.x); PlayerPrefs.SetInt(PrefsEntity.CurrentY, (int)entrance.y); } PlayerPrefsX.SetVector2(PrefsEntity.Entrance, entrance); fieldEventContainer[(int)entrance.x, (int)entrance.y] = newTile; fieldEventFlag[(int)entrance.x, (int)entrance.y] = FieldEventType.Entrance; } else { i--; } } }
public void AddEvent(EventCard which) { if (PlayerPrefsX.GetBool(which.name)) { switch (which.myType) { case EventCard.eType.Curse: if (!curseCards.Contains(which)) { curseCards.Add(which); } break; case EventCard.eType.Bonus: if (!bonusCards.Contains(which)) { bonusCards.Add(which); } break; case EventCard.eType.Mis: if (!miscCards.Contains(which)) { miscCards.Add(which); } break; } } }