This commit is contained in:
huqibin 2025-02-18 16:33:50 +08:00
parent 4a7efc7459
commit ba1944260c
3 changed files with 62 additions and 32 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<TB_System id="10009" systemName="数字化计量箱巡视及异常消缺仿真" loadName="数字化计量箱巡视及异常消缺仿真" titleName="数字化计量箱巡视及异常消缺仿真"> <TB_System id="10009" systemName="数字化计量箱巡视及异常消缺仿真" loadName="数字化计量箱巡视及异常消缺仿真" titleName="数字化计量箱巡视及异常消缺仿真">
<Subject id="9001" deviceTypeId="90001" schemeName="直接接入式电能计量装置" deviceMap="单相表" isFault="0" schemeDes="" ToolOrMaterilOrDevice="剥线钳,绝缘铲,验电笔,国网安全帽,工作服,绝缘手套,绝缘靴,工作证,盒装封印,绝缘胶带,三相四线费控智能电能表,盒装计量箱电子标签,手机"> <Subject id="9001" deviceTypeId="90001" schemeName="直接接入式电能计量装置" deviceMap="单相表" isFault="0" schemeDes="" ToolOrMaterilOrDevice="剥线钳,绝缘铲,验电笔,国网安全帽,工作服,绝缘手套,绝缘靴,工作证,盒装封印,绝缘胶带,三相四线费控智能电能表,盒装计量箱电子标签,手机,万用表">
<Process id="" processName="准备工作" processDes=""> <Process id="" processName="准备工作" processDes="">

View File

@ -110,7 +110,7 @@ public class DataManager : BaseManager<DataManager>
toolAndMaterialDic.Add(tB_ToolAndMaterial.id, tB_ToolAndMaterial); toolAndMaterialDic.Add(tB_ToolAndMaterial.id, tB_ToolAndMaterial);
} }
} }
private void ReadSubecjtXML(string path) public void ReadSubecjtXML(string path)
{ {
XmlDocument xmlDoc = new XmlDocument(); XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(path); xmlDoc.Load(path);
@ -218,16 +218,35 @@ public class DataManager : BaseManager<DataManager>
/// <returns></returns> /// <returns></returns>
public List<D_ToolAndMaterialData> GetCurrentSystemToolAndMaterials(string tOrMOrD) public List<D_ToolAndMaterialData> GetCurrentSystemToolAndMaterials(string tOrMOrD)
{ {
#region ToolOrMaterilOrDevice去获取当前科目所需要的工具设备
//var currentSystemToolAndMaterials = new List<D_ToolAndMaterialData>();
//string[] tmdTemp = tOrMOrD.Split(',');
//for (int i = 0; i < tmdTemp.Length; i++)
//{
// int index = i;
// foreach (var item in toolAndMaterialDic.Values)
// {
// if (item.objName == tmdTemp[index])
// {
// D_ToolAndMaterialData d_ToolAndMaterialData = new D_ToolAndMaterialData();
// d_ToolAndMaterialData.id = item.id;
// d_ToolAndMaterialData.objName = item.objName;
// d_ToolAndMaterialData.type = item.type;
// d_ToolAndMaterialData.prefabName = item.prefabName;
// d_ToolAndMaterialData.iconSpriteName = item.iconSpriteName;
// currentSystemToolAndMaterials.Add(d_ToolAndMaterialData);
// }
// }
//}
//return currentSystemToolAndMaterials;
#endregion
#region
var currentSystemToolAndMaterials = new List<D_ToolAndMaterialData>(); var currentSystemToolAndMaterials = new List<D_ToolAndMaterialData>();
string[] tmdTemp = tOrMOrD.Split(',');
for (int i = 0; i < tmdTemp.Length; i++)
{
int index = i;
foreach (var item in toolAndMaterialDic.Values) foreach (var item in toolAndMaterialDic.Values)
{
if (item.objName == tmdTemp[index])
{ {
D_ToolAndMaterialData d_ToolAndMaterialData = new D_ToolAndMaterialData(); D_ToolAndMaterialData d_ToolAndMaterialData = new D_ToolAndMaterialData();
d_ToolAndMaterialData.id = item.id; d_ToolAndMaterialData.id = item.id;
@ -237,9 +256,8 @@ public class DataManager : BaseManager<DataManager>
d_ToolAndMaterialData.iconSpriteName = item.iconSpriteName; d_ToolAndMaterialData.iconSpriteName = item.iconSpriteName;
currentSystemToolAndMaterials.Add(d_ToolAndMaterialData); currentSystemToolAndMaterials.Add(d_ToolAndMaterialData);
} }
}
}
return currentSystemToolAndMaterials; return currentSystemToolAndMaterials;
#endregion
} }

View File

@ -281,10 +281,10 @@ public class LiveSceneManager : SingletonMono<LiveSceneManager>
private void OnDestroy() private void OnDestroy()
{ {
firstPersonController.zoomAction -= OnZoom; firstPersonController.zoomAction -= OnZoom;
GameManager.EventMgr?.EventTrigger<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, null); currentTool = null;
GameManager.EventMgr?.RemoveEventListener<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, SetSpawnToolInfo); GameManager.EventMgr.EventTrigger<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, null);
GameManager.EventMgr?.RemoveEventListener<bool>(Enum_EventType.PlayerCanMove, SwitchFirstPersonControllerMove); GameManager.EventMgr.RemoveEventListener<bool>(Enum_EventType.PlayerCanMove, SwitchFirstPersonControllerMove);
GameManager.EventMgr.RemoveEventListener<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, SetSpawnToolInfo);
//清空设备铭牌核对选项 //清空设备铭牌核对选项
UI_CheckDevicePanel.isCheck互感器A相 = false; UI_CheckDevicePanel.isCheck互感器A相 = false;
UI_CheckDevicePanel.isCheck互感器B相 = false; UI_CheckDevicePanel.isCheck互感器B相 = false;
@ -304,12 +304,24 @@ public class LiveSceneManager : SingletonMono<LiveSceneManager>
} }
private void OnDisable() private void OnDisable()
{ {
//StopCoroutine(WaitSetJiaoYanYiState()); //firstPersonController.zoomAction -= OnZoom;
//StopCoroutine(WaitSetJiaoYanYiYiQiState()); //currentTool = null;
//StopCoroutine(WaitSetJiaoYanYiScreenState()); //GameManager.EventMgr.EventTrigger<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, null);
firstPersonController.zoomAction -= OnZoom; //GameManager.EventMgr.RemoveEventListener<bool>(Enum_EventType.PlayerCanMove, SwitchFirstPersonControllerMove);
GameManager.EventMgr?.EventTrigger<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, null); //GameManager.EventMgr.RemoveEventListener<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, SetSpawnToolInfo);
GameManager.EventMgr?.RemoveEventListener<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, SetSpawnToolInfo); ////清空设备铭牌核对选项
GameManager.EventMgr?.RemoveEventListener<bool>(Enum_EventType.PlayerCanMove, SwitchFirstPersonControllerMove); //if (GameManager.UIMgr.GetPanel<UI_CheckDevicePanel>())
//{
// GameManager.UIMgr.GetPanel<UI_CheckDevicePanel>().isCheck互感器A相 = false;
// GameManager.UIMgr.GetPanel<UI_CheckDevicePanel>().isCheck互感器B相 = false;
// GameManager.UIMgr.GetPanel<UI_CheckDevicePanel>().isCheck互感器C相 = false;
// GameManager.UIMgr.GetPanel<UI_CheckDevicePanel>().isCheck电能表 = false;
//}
////删除核对按钮
//if (CheckDeviceButtonPanel.instance != null)
//{
// CheckDeviceButtonPanel.instance.MyDesTroy();
//}
Debug.Log(" OnDisable()");
} }
} }