Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var goldAmount : int = 0;
- function Start(){
- goldAmount = PlayerPrefs.GetInt("TheGame");//Gets int from Player Prefs file(loads).
- }
- function Update(){
- if(Input.GetMouseButtonDown(0)){
- PlayerPrefs.SetInt("TheGame", 15);//Sets int from Player Prefs file(saves).
- }
- }
- function FixedUpdate(){
- if(goldAmount == 15){
- Application.LoadLevel("Level2");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment