Hi, this script works, but does not show the gui in the game, someone knows how to fix it
using UnityEngine;
using System.Collections;
public class PlayTime : MonoBehaviour {
public int PlayTimer = 0; // Sirve para manipular el tiempo de juego.
public int seconds = 0;
private int minutes = 0;
private int hours = 0;
// Inicializa la funcion
void Start () {
StartCoroutine("playTimer");
}
private IEnumerator playTimer()
{
while (true)
{
yield return new WaitForSeconds(1);
PlayTimer +=1;
seconds = (PlayTimer % 60);
minutes = (PlayTimer / 60) % 60;
hours = (PlayTimer / 3600) % 24;
}
}
void onGUI()
{
GUI.TextArea(new Rect(10,10, 50,20), "PlayTimer = " + hours.ToString() + " Hours " + minutes.ToString() + " Minutes " + seconds.ToString() + " Seconds ");
}
}
Thanks:)