Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using UnityEngine.SceneManagement;
  4.  
  5. public class GameController : MonoBehaviour {
  6. private int score;
  7.  
  8. // Use this for initialization
  9. void Start ()
  10. {
  11.  
  12. score = 0;
  13. UpdateScore ();
  14. }
  15.  
  16. // Update is called once per frame
  17. void Update ()
  18. {
  19. if (score == 2) {
  20.  
  21. SceneManager.LoadScene ("YouWin");
  22. Debug.Log ("you have changed the scenes");
  23.  
  24. }
  25. }
  26. public void AddScore (int newScoreValue)
  27. {
  28. score =+ newScoreValue;
  29. UpdateScore ();
  30. }
  31.  
  32. void UpdateScore ()
  33. {
  34. //scoreText.text = "Score: " + score;
  35. Debug.Log ("Total Score = " + score);
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement