Skip to content
Snippets Groups Projects
DisplayRuntimeValue.cs 748 B
Newer Older
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;

public class DisplayRuntimeValue : MonoBehaviour
{
    public GameObject protocolGameObject;

    ProtocolHandler protocolHandler;
    float runtimeMinutes = 1;
    // Start is called before the first frame update
    void Start()
    {
        protocolHandler = protocolGameObject.GetComponent<ProtocolHandler>();
    }

    // Update is called once per frame
    void Update()
    {

    }

    public void DisplayRuntime()
    {
        TMP_Text displayText = this.GetComponent<TMP_Text>();
Raymond Chia's avatar
Raymond Chia committed
        runtimeMinutes = protocolHandler.TotalRuntime;
        string text = runtimeMinutes.ToString();
        displayText.SetText(text);
    }
}