using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ShowGameTime : MonoBehaviour { [SerializeField] Text playTimeText; const long PayTimeCountDown = 60 * 1000; private void Start() { //StandaloneAPI.StartGameTimeCountDown(); } // Update is called once per frame void Update() { StandaloneAPI.DoGameTimeCountDown(); playTimeText.text = string.Format("Ê£Óàʱ¼ä{0}", GetTimeStr()); } string GetTimeStr() { long second = StandaloneAPI.GetGameTimeCountDown() / 1000; long minute = second / 60; second = second % 60; string str = second + "Ãë"; if (minute > 0) str = minute + "·Ö" + str; return str; } }