Erwin23p

TileManager.cs

Sep 27th, 2016
73
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2.  
  3. public class TileManager : MonoBehaviour
  4. {
  5.  
  6.     public static float score;
  7.  
  8.     //Bool used to detect if the player has got any score added
  9.     public static bool gotScore;
  10.  
  11.     // Update is called once per frame
  12.     void Update()
  13.     {
  14.         //here you should have the score added script, I'll put a simple press key 1 to test
  15.         if (Input.GetKeyDown(KeyCode.Alpha1))
  16.         {
  17.             GetScore();
  18.         }
  19.     }
  20.  
  21.     //Method of getting points
  22.     void GetScore()
  23.     {
  24.         //Adds 1 to score
  25.         score ++;
  26.         //Turns bool true to show that we got more score
  27.         gotScore = true;
  28.     }
  29. }
RAW Paste Data