Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using UnityEngine.SceneManagement;
- public class GameController : MonoBehaviour {
- private int score;
- // Use this for initialization
- void Start ()
- {
- score = 0;
- UpdateScore ();
- }
- // Update is called once per frame
- void Update ()
- {
- if (score == 2) {
- SceneManager.LoadScene ("YouWin");
- Debug.Log ("you have changed the scenes");
- }
- }
- public void AddScore (int newScoreValue)
- {
- score =+ newScoreValue;
- UpdateScore ();
- }
- void UpdateScore ()
- {
- //scoreText.text = "Score: " + score;
- Debug.Log ("Total Score = " + score);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement