using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; public class GameCtrl : MonoBehaviour { [SerializeField] TMP_Text[] goldText; [SerializeField] TMP_Text[] cashText; public void StartPlay() { GameManager.Instance.NextScene(GameManager.eScene.Play); } public void OnSetting() { SettingWindws.Instance.SetUI(true); } private void OnEnable() { MoneyUpdate(); } public void MoneyUpdate() { for(int n = 0; n < goldText.Length; n++) { goldText[n].text = Statics.gold.ToString(); } for (int n = 0; n < cashText.Length; n++) { cashText[n].text = Statics.cash.ToString(); } } }