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
736 B
25 lines
736 B
using System; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using UnityEngine.UI; |
|
/// <summary> |
|
/// 供水报告-获取已用水量 |
|
/// </summary> |
|
public class GetAllUsed : MonoBehaviour |
|
{ |
|
private FloatData data = new FloatData(0); |
|
/// <summary> |
|
/// 供水报告-获取已用水量 |
|
/// </summary> |
|
public static event Func<FloatData, FloatData> getAllUsedAmount; |
|
private void OnEnable() |
|
{ |
|
data.Clear(); |
|
if(getAllUsedAmount != null) |
|
{ |
|
data = getAllUsedAmount(data); |
|
} |
|
GetComponent<Text>().text = data.value > 1000 ? Math.Round(data.value / 1000, 2).ToString() + " T" : Math.Round(data.value, 2).ToString() + " L"; |
|
} |
|
}
|
|
|