How would I Implement a “Points” System into this code. Basically I want it to go to the next scene when all the boxes have been deleted. I know i need a var “something” : int; but i dont know how to make it add +1 everytime one guy gets deleted.
(This script is added to each block so when it is clicked, It gets deleted.)
var destroy;
function Start(){
destroy = false;
}
function OnMouseOver(){
if(Input.GetMouseButtonUp(0)){
destroy = true;
}else{
destroy = false;
}
}
function Update(){
if(destroy){
Destroy(gameObject);
}
}