333GameStudio

GameManager

Jul 3rd, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  var goldAmount : int = 0;
  3.  
  4. function Start(){
  5.  
  6. goldAmount = PlayerPrefs.GetInt("TheGame");//Gets int from Player Prefs file(loads).
  7.  
  8. }
  9. function Update(){
  10. if(Input.GetMouseButtonDown(0)){
  11.  
  12.  
  13. PlayerPrefs.SetInt("TheGame", 15);//Sets int from Player Prefs file(saves).
  14.  
  15.  
  16. }
  17. }
  18. function FixedUpdate(){
  19. if(goldAmount == 15){
  20.  
  21.  
  22. Application.LoadLevel("Level2");
  23.  
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment