I am getting the following error: Trying to Invoke method: scriptSceneManager.CountDown couldn’t be called.
Code:
//scene manager sctipt
//inspector variables
public var GameTime : float = 60;
static var score : int = 0;
static var lives : int = 3;
var labelRight : float = 75;
//private variables
//game loop
function Start()
{
InvokeRepeating("CoundDown", 1.0, 1.0);
}
function Update ()
{
//print score
print("score: " + score);
}
public function AddScore()
{
score +=1;
}
public function SubtractLife()
{
lives -=1;
}
function CountDown()
{
if( -- GameTime == 0)
{
CancelInvoke("CoundDown");
}
}
function OnGUI ()
{
GUI.Label (Rect (10,10,100,20), "Score: "+ score);
GUI.Label (Rect (10,25,100,35), "Lives: "+ lives);
GUI.Label (Rect (Screen.width-labelRight, 10, 100, 20), "Counter: " + GameTime);
//GUI.Label(Rect(125,75, 60, 20), "Time : " + GameTime);
}