// Update is called once per frame void ApplyTimer(float _timer) { float timeRate = G20_Timer.GetInstance().CurrentTime / G20_Timer.GetInstance().FirstTime; UIDonatu.fillAmount = timeRate; string timeStr = string.Format("{0:0.0}", _timer); UItext.text = timeStr; }
public void IngameStart() { var stageType = G20_GameManager.GetInstance().gameDifficulty; if (stageType >= stageBehaviourPrefabs.Length) { stageType = 0; } var stageObj = Instantiate(stageBehaviourPrefabs[(int)stageType], transform); nowStageBehaviour = stageObj.GetComponent <G20_StageBehaviour>(); float stageTotalTime = nowStageBehaviour.stageTotalTime; G20_Timer.GetInstance().StartTimer(stageTotalTime); }
// Use this for initialization void Update() { ApplyTimer(G20_Timer.GetInstance().CurrentTime); }