/// <summary> /// 处理加药流程 /// </summary> /// <param name="jn"></param> /// <param name="isOnline"></param> public void DealTankMsg(JSONNode jn, bool isOnline = false) { string index = isOnline ? jn["job"]["status"] : jn["status"]; if (string.IsNullOrEmpty(index)) { return; } string curStep = MessageLibrary.GetMessage(index); if (curStep == "10") { string tankARName = isOnline ? jn["job"]["prodTitle"] : jn["prodTitle"]; curStep = MessageLibrary.GetMessage("ARTank_" + tankARName); } if (index == "11" || index == "13") { UIManager.ShowStayMessage(""); } else { UIManager.ShowStayMessage(curStep); } GlobalManager.LoadScene(index == "10" ? "Tank" : "WorkFlow"); }
public void AddSelfEvent() { #region 旧的代码 // socketService.InitScene("tank", // (socket, packet, args) => // { // Debug.LogError("Init Scene.." + packet.Payload); // DealState(packet.Payload, true); // }); //监听流程 // socketService.AddListener(EventConfig.AR_WORKFLOW, // (socket, packet, args) => // { // Debug.Log(packet.Payload); // DealState(packet.Payload); // }); // socketService.AddListener(EventConfig.PHOTO, // (socket, packet, args) => // { // Debug.LogError("Callback PHOTO --> " + packet.Payload); // UIManager.ShowStayMessage(MessageLibrary.GetMessage(JSON.Parse(packet.Payload)[1]["status"])); // MainSceneMgr.MainMgr.LoadScene("TakePhoto"); // }); #endregion WebManager.Instance.Connect("tank", node => { DealTankMsg(node[0], true); }); // WebManager.Instance.On(EventConfig.AR_ONLINE, node => // { // DealTankMsg(node[0], true); // }); WebManager.Instance.On(EventConfig.AR_WORKFLOW, node => { DealTankMsg(node[0]); }); WebManager.Instance.On(EventConfig.PHOTO, node => { UIManager.ShowStayMessage(MessageLibrary.GetMessage(node[1]["status"])); GlobalManager.LoadScene("TakePhoto"); }); }