You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
655 B
25 lines
655 B
using System; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using UnityEngine.UI; |
|
|
|
/// <summary> |
|
/// 获取正在喷水的车辆数 |
|
/// </summary> |
|
public class GetSprayingCount : MonoBehaviour { |
|
private IntData data = new IntData(0); |
|
/// <summary> |
|
/// 获取正在喷水/喷泡沫的车辆数 |
|
/// </summary> |
|
public static event Func<IntData, IntData> getSprayingTrucksCount; |
|
void OnEnable() |
|
{ |
|
data.Clear(); |
|
if(getSprayingTrucksCount != null) |
|
{ |
|
data = getSprayingTrucksCount(data); |
|
} |
|
GetComponent<Text>().text = data.value + "辆"; |
|
} |
|
}
|
|
|