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.
32 lines
928 B
32 lines
928 B
4 years ago
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
/// <summary>
|
||
|
/// 获取到场泡沫量
|
||
|
/// </summary>
|
||
|
public class GetAllFoam : MonoBehaviour {
|
||
|
private IntData data = new IntData(0);
|
||
|
public static event Func<IntData, IntData> getAllFoamAmount;
|
||
|
private void OnEnable()
|
||
|
{
|
||
|
data.Clear();
|
||
|
if (getAllFoamAmount != null)
|
||
|
{
|
||
|
data = getAllFoamAmount(data);
|
||
|
}
|
||
|
//因为TrukMessage中MyCarMessage实例里的载水量,载泡沫量默认单位为吨,所以以下转换是错误的
|
||
|
//if(data.value < 1000)
|
||
|
//{
|
||
|
// GetComponent<Text>().text = data.value.ToString() + "L";
|
||
|
//}
|
||
|
//else
|
||
|
//{
|
||
|
// GetComponent<Text>().text = (data.value/1000).ToString() + "T";
|
||
|
//}
|
||
|
|
||
|
GetComponent<Text>().text = data.value.ToString() + "T";
|
||
|
}
|
||
|
}
|