15 private float TimeToWait = 1.0f;
18 private TextMesh textMesh = null;
25 private void OnDisable()
30 private void OnButtonPressed(
TestButton source)
33 StartCoroutine(WaitForTime(TimeToWait));
36 IEnumerator WaitForTime(
float timeToWait)
38 float currentTime = 0.0f;
40 while (currentTime <= timeToWait)
42 currentTime += Time.deltaTime;
43 textMesh.text = ((currentTime / timeToWait) * 100.0f).ToString(
"F0") +
"%";
49 textMesh.text =
"Wait";