I am faced with yet another problem. My scenario is this:
I am doing a guess the difference game so i have a count up timer that records the time taken. My problem is that when the user presses on a wrong part of the picture to increase his time by an amount.
For example here is my script:
var startTime:int =0;
var x1 : int = 0;
function Update ()
{
timeTaken= startTime + Time.time;
guiText.text = FormatTime (timeTaken);
}
function FormatTime (time)
{
var intTime : int = time;
var minutes : int = intTime / 60;
var seconds : int = intTime % 60;
var fraction : int = time * 10;
fraction = fraction % 10;
//Build string with format
// 17[minutes]:21[seconds]:05[fraction]
timeText = seconds.ToString ();
timeText += ":" + fraction.ToString ();
return timeText;
}
what should be static so that I could increase my time from another script and how do i increase the time by 1 second in the counter for example! thanks!