Quantcast
Channel: Questions in topic: "playerprefs"
Viewing all articles
Browse latest Browse all 1333

Why my LevelSelect Dont unlock

$
0
0
**Why if (PlayerPrefs.HasKey ("Level")) Doesn't Work** void Start () { playerInZone = false; } // Update is called once per frame void Update () { if (playerInZone) { PlayerPrefs.SetInt ("Level", ThisLevel); Application.LoadLevel (levelToLoad); } } void OnTriggerEnter2D(Collider2D other) { if (other.name == "Player") { playerInZone = true; } } void OnTriggerExit2D(Collider2D other) { if (other.name == "Player") { playerInZone = false; } } } void Start () { } // Update is called once per frame void Update () { if (PlayerPrefs.HasKey ("Level")) { LevelReached = PlayerPrefs.GetInt ("Level"); if (LevelReached >= ThisLevel) { LevelUnlock (); } } } void LevelUnlock () { GetComponent

Viewing all articles
Browse latest Browse all 1333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>