using System.Collections; using System.Collections.Generic; using UnityEngine; public class LoadingView : MonoBehaviour { private UnityEngine.UI.Text mText; private float shengyushijian; private void Awake() { mText = this.GetComponentInChildren(); } private void OnEnable() { shengyushijian = 3f; } // Update is called once per frame void Update () { shengyushijian -= Time.deltaTime; if(mText != null) mText.text = ""+ Mathf.Floor(Mathf.Max(0, shengyushijian)); } }