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.
37 lines
1.4 KiB
37 lines
1.4 KiB
5 years ago
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
public class ArrivedForceItem : MonoBehaviour {
|
||
|
public Text fullName; //全名
|
||
|
public Text water; //载水量
|
||
|
public Text foam; //载泡沫量
|
||
|
public Text height; //高度
|
||
|
public Text num; //载人数量
|
||
|
private void Awake()
|
||
|
{
|
||
|
fullName = transform.Find("FullName").GetComponent<Text>();
|
||
|
water = transform.Find("WaterAmount").GetComponent<Text>();
|
||
|
foam = transform.Find("FoamAmount").GetComponent<Text>();
|
||
|
height = transform.Find("Height").GetComponent<Text>();
|
||
|
num = transform.Find("Num").GetComponent<Text>();
|
||
|
}
|
||
|
public void Set(TruckMessage msg)
|
||
|
{
|
||
|
fullName.text = msg.FullName;
|
||
|
water.text = msg.MyCarMessage.WaterAmount.ToString();
|
||
|
foam.text = msg.MyCarMessage.FoamAmount.ToString();
|
||
|
height.text = msg.MyCarMessage.Height.ToString();
|
||
|
num.text = msg.MyCarMessage.PassengerCapacity.ToString();
|
||
|
}
|
||
|
public void Set(string team,FireCarEngine fireCarEngine,int num)
|
||
|
{
|
||
|
fullName.text = team + "-" + fireCarEngine.TypeName + "-" + (num + 1).ToString();
|
||
|
water.text = fireCarEngine.WaterAmount.ToString();
|
||
|
foam.text = fireCarEngine.FoamAmount.ToString();
|
||
|
height.text = fireCarEngine.Height.ToString();
|
||
|
this.num.text = fireCarEngine.PassengerCapacity.ToString();
|
||
|
}
|
||
|
}
|