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.
57 lines
1.8 KiB
57 lines
1.8 KiB
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using AX.MessageSystem; |
|
using System; |
|
using MobileCFFSInfo; |
|
using UnityEngine.UI; |
|
|
|
/// <summary> |
|
/// 获取需发送给移动指挥终端的车辆信息 的脚本 |
|
/// </summary> |
|
public class GetCarInfos : MonoBehaviour { |
|
|
|
// Use this for initialization |
|
void Awake () { |
|
MessageDispatcher.AddListener("GET_TRUCKINFOS", TruckInfosGet); |
|
} |
|
|
|
private void OnDestroy() |
|
{ |
|
MessageDispatcher.RemoveListener("GET_TRUCKINFOS", TruckInfosGet); |
|
} |
|
|
|
private void TruckInfosGet(IMessage obj) |
|
{ |
|
List<FireTruckInfo> FireTruckInfos = (List<FireTruckInfo>)obj.Data; |
|
|
|
FireTruckInfo truckInfo = new FireTruckInfo(); |
|
truckInfo.FireSquadron = gameObject.name.Split('-')[0]; |
|
|
|
if (TO_3D_PLAN_SYNC.BuildingId == 2) |
|
{//天津站场景 |
|
truckInfo.Position = PositionConversion.PosConvertOfScene2(transform.position); |
|
} |
|
if (TO_3D_PLAN_SYNC.BuildingId == 1) |
|
{//恒隆广场场景 |
|
truckInfo.Position = PositionConversion.PosConvertOfScene9(transform.position); |
|
} |
|
if (TO_3D_PLAN_SYNC.BuildingId == 0) |
|
{//津塔站场景 |
|
truckInfo.Position = PositionConversion.PosConvertOfScene11(transform.position); |
|
} |
|
|
|
|
|
truckInfo.Type = GetComponent<CarMessage>().Type; |
|
truckInfo.Type3D = GetComponent<Enemy>().enemy.transform.Find("Name").GetComponent<TextMesh>().text.Split('-')[1]; |
|
truckInfo.PlateNumber = gameObject.name.Split('-')[3]; |
|
truckInfo.Mission = GetComponent<Enemy>().enemy.transform.Find("Function").GetComponent<TextMesh>().text; |
|
|
|
FireTruckInfos.Add(truckInfo); |
|
} |
|
|
|
// Update is called once per frame |
|
void Update () { |
|
|
|
} |
|
}
|
|
|