using UnityEngine; /// /// 指令触发 /// public class InstructionTriggered : MonoBehaviour { private void Start() { SoftManage.Instance.SetSoftAction(ReceiveMessage); } /// /// 二维软件接受消息 /// /// /// private void ReceiveMessage(string data, string softname) { if (SoftManage.Instance.CanHandle(softname)) { Debug.Log("Recive Msg: " + data); Debug.Log("Recive Msg: " + softname); if (softname.Equals("车控软件")) { string[] contents = data.Split('|'); if (contents.Length > 1) { int orderCode = 0; int.TryParse(contents[0], out orderCode); string orderStateStr = contents[1]; int orderState = -100; int.TryParse(orderStateStr, out orderState); if (contents[0] == "停止继续") { CarPartsDriver.instance.StopMechanism(); return; } CarPartsDriver.instance.DriveMechanism(orderCode, orderState); #region //if (10000 < orderCode && orderCode <= 10020) //{ //TruckCarBody.instance.ManageMsg(orderCode, orderState); // } // else if(orderCode== 10025) //{ //TruckCarFaSheTai.instance.ManageMsg(orderCode, orderState); //} //TruckCarHuoJian.instance.ManageMsg(orderCode, orderState); #endregion } } else if (softname.Equals("瞄准系统软件")) { Debug.Log("Recive Msg:111"); // rc.ManageMsg(data); } } } }