I have a question here. Is there any way to display the time consumed on the panel?
There is a counter I set for the countdown in Quest Machine. I have tried using the script to display, but I do not know what's wrong with my script.
Here is my code:
Code: Select all
public Text timerText;
private float startTime;
public QuestState newState;
void Start(){
startTime = Time.time;
}
void CaptureTime (){
string minutes;
if (newState == QuestState.Active){
Debug.Log("1");
float t = Time.time - startTime;
minutes = ((int)t / 60).ToString("00");
string seconds = (t % 60).ToString("00");
timerText.text = minutes + ":" + seconds;
}
}
void Update(){
CaptureTime();
}
Thanks for your time and sorry if troubling you.