Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class TileManager : MonoBehaviour
- {
- public static float score;
- //Bool used to detect if the player has got any score added
- public static bool gotScore;
- // Update is called once per frame
- void Update()
- {
- //here you should have the score added script, I'll put a simple press key 1 to test
- if (Input.GetKeyDown(KeyCode.Alpha1))
- {
- GetScore();
- }
- }
- //Method of getting points
- void GetScore()
- {
- //Adds 1 to score
- score ++;
- //Turns bool true to show that we got more score
- gotScore = true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement