using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class UsedHoseValue : MonoBehaviour { public static event Func getAllUsedHose; private void OnEnable() { //int value = 0; IntData data = new IntData(0); if(getAllUsedHose != null) { //value = getAllUsedHose(value); data = getAllUsedHose(data); } GetComponent().text = data.value.ToString() + "盘"; } }