修改config表格T_Scheme数据结构,添加背包数据类,修改背包逻辑,添加脚本ToolRoomManager,修改工具选择脚本。
This commit is contained in:
parent
2633450d10
commit
1f57690529
Assets
ArtRes/Excel
Resources/Prefabs/Objects/Tools
万用表.prefab剥线钳.prefab国网安全帽.prefab工作服.prefab工作证.prefab盒装封印.prefab绝缘手套.prefab绝缘胶带.prefab绝缘螺丝刀.prefab绝缘靴.prefab验电笔.prefab
Scenes
Scripts
ExcelData/DataClass
Project
DataClass
Enum
Manager
DataManager.csProcessManager.csRunModelMgr.csTooRoomlMannger.csTooRoomlMannger.cs.metaToolAndmaterialMgr.cs
Objects
UI/UI_Panel
StreamingAssets/BinaryData
Binary file not shown.
|
@ -60,11 +60,12 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
toolId: 0
|
itemInfo:
|
||||||
toolName:
|
toolId: 0
|
||||||
toolOrDeviceOrMaterial: 0
|
triggerID: 0
|
||||||
|
toolName:
|
||||||
|
toolOrDeviceOrMaterial: 0
|
||||||
_highlight: {fileID: 0}
|
_highlight: {fileID: 0}
|
||||||
IsClick: 1
|
|
||||||
--- !u!114 &2468428323860960022
|
--- !u!114 &2468428323860960022
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -60,11 +60,12 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
toolId: 0
|
itemInfo:
|
||||||
toolName:
|
toolId: 0
|
||||||
toolOrDeviceOrMaterial: 1
|
triggerID: 0
|
||||||
|
toolName:
|
||||||
|
toolOrDeviceOrMaterial: 0
|
||||||
_highlight: {fileID: 0}
|
_highlight: {fileID: 0}
|
||||||
IsClick: 1
|
|
||||||
--- !u!114 &2186571632370376101
|
--- !u!114 &2186571632370376101
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -60,11 +60,12 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
toolId: 0
|
itemInfo:
|
||||||
toolName:
|
toolId: 0
|
||||||
toolOrDeviceOrMaterial: 0
|
triggerID: 0
|
||||||
|
toolName:
|
||||||
|
toolOrDeviceOrMaterial: 1
|
||||||
_highlight: {fileID: 0}
|
_highlight: {fileID: 0}
|
||||||
IsClick: 1
|
|
||||||
--- !u!114 &2906462593900441407
|
--- !u!114 &2906462593900441407
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -60,11 +60,12 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
toolId: 0
|
itemInfo:
|
||||||
toolName:
|
toolId: 0
|
||||||
toolOrDeviceOrMaterial: 0
|
triggerID: 0
|
||||||
|
toolName:
|
||||||
|
toolOrDeviceOrMaterial: 0
|
||||||
_highlight: {fileID: 0}
|
_highlight: {fileID: 0}
|
||||||
IsClick: 1
|
|
||||||
--- !u!114 &2397141117729196589
|
--- !u!114 &2397141117729196589
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -143,11 +143,12 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
toolId: 0
|
itemInfo:
|
||||||
toolName:
|
toolId: 0
|
||||||
toolOrDeviceOrMaterial: 0
|
triggerID: 0
|
||||||
|
toolName:
|
||||||
|
toolOrDeviceOrMaterial: 0
|
||||||
_highlight: {fileID: 0}
|
_highlight: {fileID: 0}
|
||||||
IsClick: 1
|
|
||||||
--- !u!114 &9159459832370388555
|
--- !u!114 &9159459832370388555
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -499,11 +499,12 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
toolId: 0
|
itemInfo:
|
||||||
toolName:
|
toolId: 0
|
||||||
toolOrDeviceOrMaterial: 0
|
triggerID: 0
|
||||||
|
toolName:
|
||||||
|
toolOrDeviceOrMaterial: 0
|
||||||
_highlight: {fileID: 0}
|
_highlight: {fileID: 0}
|
||||||
IsClick: 1
|
|
||||||
--- !u!65 &3014182739139812810
|
--- !u!65 &3014182739139812810
|
||||||
BoxCollider:
|
BoxCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -48,11 +48,12 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
toolId: 0
|
itemInfo:
|
||||||
toolName:
|
toolId: 0
|
||||||
toolOrDeviceOrMaterial: 0
|
triggerID: 0
|
||||||
|
toolName:
|
||||||
|
toolOrDeviceOrMaterial: 0
|
||||||
_highlight: {fileID: 0}
|
_highlight: {fileID: 0}
|
||||||
IsClick: 1
|
|
||||||
--- !u!65 &5298069477168308409
|
--- !u!65 &5298069477168308409
|
||||||
BoxCollider:
|
BoxCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -60,11 +60,12 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
toolId: 0
|
itemInfo:
|
||||||
toolName:
|
toolId: 0
|
||||||
toolOrDeviceOrMaterial: 0
|
triggerID: 0
|
||||||
|
toolName:
|
||||||
|
toolOrDeviceOrMaterial: 0
|
||||||
_highlight: {fileID: 0}
|
_highlight: {fileID: 0}
|
||||||
IsClick: 1
|
|
||||||
--- !u!114 &2357552334371453598
|
--- !u!114 &2357552334371453598
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -48,11 +48,12 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
toolId: 0
|
itemInfo:
|
||||||
toolName:
|
toolId: 0
|
||||||
toolOrDeviceOrMaterial: 0
|
triggerID: 0
|
||||||
|
toolName:
|
||||||
|
toolOrDeviceOrMaterial: 0
|
||||||
_highlight: {fileID: 0}
|
_highlight: {fileID: 0}
|
||||||
IsClick: 1
|
|
||||||
--- !u!65 &2292098275725943769
|
--- !u!65 &2292098275725943769
|
||||||
BoxCollider:
|
BoxCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -47,11 +47,12 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
toolId: 0
|
itemInfo:
|
||||||
toolName:
|
toolId: 0
|
||||||
toolOrDeviceOrMaterial: 0
|
triggerID: 0
|
||||||
|
toolName:
|
||||||
|
toolOrDeviceOrMaterial: 0
|
||||||
_highlight: {fileID: 0}
|
_highlight: {fileID: 0}
|
||||||
IsClick: 1
|
|
||||||
--- !u!65 &7642060814474931475
|
--- !u!65 &7642060814474931475
|
||||||
BoxCollider:
|
BoxCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -47,11 +47,12 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
m_Script: {fileID: 11500000, guid: a6f31a9609373b04faa317bc87afe550, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
toolId: 0
|
itemInfo:
|
||||||
toolName:
|
toolId: 0
|
||||||
toolOrDeviceOrMaterial: 0
|
triggerID: 0
|
||||||
|
toolName:
|
||||||
|
toolOrDeviceOrMaterial: 0
|
||||||
_highlight: {fileID: 0}
|
_highlight: {fileID: 0}
|
||||||
IsClick: 1
|
|
||||||
--- !u!65 &2828524944087783442
|
--- !u!65 &2828524944087783442
|
||||||
BoxCollider:
|
BoxCollider:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -6,4 +6,5 @@ public class TB_Scheme
|
||||||
public string schemeName;
|
public string schemeName;
|
||||||
public string deviceMap;
|
public string deviceMap;
|
||||||
public string schemeDes;
|
public string schemeDes;
|
||||||
|
public string ToolOrMaterilOrDevice;
|
||||||
}
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
public class TB_ToolAndMaterial
|
public class TB_ToolAndMaterial
|
||||||
{
|
{
|
||||||
public int id;
|
public int id;
|
||||||
public int schemeId;
|
|
||||||
public string objName;
|
public string objName;
|
||||||
public int type;
|
public int type;
|
||||||
public string prefabName;
|
public string prefabName;
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
/// <summary>
|
||||||
|
/// 材料/工具/设备
|
||||||
|
/// </summary>
|
||||||
|
public class D_ToolAndMaterialData
|
||||||
|
{
|
||||||
|
public int id;
|
||||||
|
public string objName;
|
||||||
|
public int type;
|
||||||
|
public string prefabName;
|
||||||
|
public string iconSpriteName;
|
||||||
|
}
|
|
@ -18,6 +18,8 @@ public class D_Scheme
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string schemeName;
|
public string schemeName;
|
||||||
|
|
||||||
|
public string ToolOrMaterilOrDevice;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
public class ToolAndMaterialData
|
|
||||||
{
|
|
||||||
public string objName;
|
|
||||||
public int type;
|
|
||||||
public uint count;
|
|
||||||
}
|
|
|
@ -97,21 +97,21 @@ public enum E_ToolOrDeviceOrMaterials
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 空
|
/// 空
|
||||||
/// </summary>
|
/// </summary>
|
||||||
None = 0,
|
None = -1,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工具
|
/// 工具
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Tool,
|
Tool = 0,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 材质
|
|
||||||
/// </summary>
|
|
||||||
Materials,
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备
|
/// 设备
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Device
|
Device = 1,
|
||||||
|
/// <summary>
|
||||||
|
/// 材质
|
||||||
|
/// </summary>
|
||||||
|
Materials = 2
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -84,23 +84,38 @@ public class DataManager : BaseManager<DataManager>
|
||||||
return allSchemeList;
|
return allSchemeList;
|
||||||
}
|
}
|
||||||
|
|
||||||
///// <summary>
|
/// <summary>
|
||||||
///// 获取当前系统全部工器具和材料
|
/// 根据方案 ToolOrMaterilOrDevice 获取当前系统全部工器具和材料
|
||||||
///// </summary>
|
/// </summary>
|
||||||
///// <returns></returns>
|
/// <returns></returns>
|
||||||
//public List<TB_ToolAndMaterial> GetCurrentSystemToolAndMaterials()
|
public List<D_ToolAndMaterialData> GetCurrentSystemToolAndMaterials(string tOrMOrD)
|
||||||
//{
|
{
|
||||||
// var currentSystemToolAndMaterials = new List<TB_ToolAndMaterial>();
|
var currentSystemToolAndMaterials = new List<D_ToolAndMaterialData>();
|
||||||
// foreach (var item in toolAndMaterialDic.Values)
|
|
||||||
// {
|
string[] tmdTemp = tOrMOrD.Split(',');
|
||||||
// if (item.systemID == GameManager.ProcessMgr.id)
|
|
||||||
// {
|
for (int i = 0; i < tmdTemp.Length; i++)
|
||||||
// currentSystemToolAndMaterials.Add(item);
|
{
|
||||||
// }
|
int index = i;
|
||||||
// }
|
foreach (var item in toolAndMaterialDic.Values)
|
||||||
|
{
|
||||||
|
if (item.id == int.Parse(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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// return currentSystemToolAndMaterials;
|
|
||||||
//}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取D_Scheme
|
/// 获取D_Scheme
|
||||||
|
@ -115,6 +130,7 @@ public class DataManager : BaseManager<DataManager>
|
||||||
{
|
{
|
||||||
d_Scheme.id = schemeDic[id].id;
|
d_Scheme.id = schemeDic[id].id;
|
||||||
d_Scheme.schemeName = schemeDic[id].schemeName;
|
d_Scheme.schemeName = schemeDic[id].schemeName;
|
||||||
|
d_Scheme.ToolOrMaterilOrDevice = schemeDic[id].ToolOrMaterilOrDevice;
|
||||||
}
|
}
|
||||||
d_Scheme.processes = GetD_Processes(d_Scheme.id);
|
d_Scheme.processes = GetD_Processes(d_Scheme.id);
|
||||||
return d_Scheme;
|
return d_Scheme;
|
||||||
|
@ -208,7 +224,7 @@ public class DataManager : BaseManager<DataManager>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<int> GetSubProcessStepIDByToolID(int toolID)
|
public List<int> GetSubProcessStepIDByTriggerID(int triggerID)
|
||||||
{
|
{
|
||||||
List<TB_SubProcessStep> tb_subProcesssSteps = new List<TB_SubProcessStep>();
|
List<TB_SubProcessStep> tb_subProcesssSteps = new List<TB_SubProcessStep>();
|
||||||
List<int> stepIDsTemp = new List<int>();
|
List<int> stepIDsTemp = new List<int>();
|
||||||
|
@ -226,7 +242,7 @@ public class DataManager : BaseManager<DataManager>
|
||||||
string[] subProcessStepToolID = item.triggerID.Split(',');
|
string[] subProcessStepToolID = item.triggerID.Split(',');
|
||||||
for (int i = 0; i < subProcessStepToolID.Length; i++)
|
for (int i = 0; i < subProcessStepToolID.Length; i++)
|
||||||
{
|
{
|
||||||
if (int.Parse(subProcessStepToolID[i]) == toolID)
|
if (int.Parse(subProcessStepToolID[i]) == triggerID)
|
||||||
stepIDsTemp.Add(item.id);
|
stepIDsTemp.Add(item.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ public class ProcessManager : BaseManager<ProcessManager>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public D_Scheme d_Scheme;
|
public D_Scheme d_Scheme;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///当前方案ID
|
///当前方案ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -76,7 +77,7 @@ public class ProcessManager : BaseManager<ProcessManager>
|
||||||
coroutine = GameManager.MonoMgr.StartCoroutine(CountDown(countDown));
|
coroutine = GameManager.MonoMgr.StartCoroutine(CountDown(countDown));
|
||||||
d_Scheme = DataManager.Instance.GetSchemeData(id);
|
d_Scheme = DataManager.Instance.GetSchemeData(id);
|
||||||
ReportManager.Instance.creport = DataManager.Instance.GetSchemeReport(id);
|
ReportManager.Instance.creport = DataManager.Instance.GetSchemeReport(id);
|
||||||
|
GameManager.ToolAndmaterialMgr.Init(d_Scheme.ToolOrMaterilOrDevice);
|
||||||
d_Scheme.Init();
|
d_Scheme.Init();
|
||||||
Debug.Log("流程初始化完成");
|
Debug.Log("流程初始化完成");
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class RunModelMgr : BaseManager<RunModelMgr>
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备/方案id
|
/// 设备/方案id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int deviceId;
|
public int schemeID;
|
||||||
|
|
||||||
|
|
||||||
public E_ModeType ModeType
|
public E_ModeType ModeType
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class TooRoomlMannger : MonoBehaviour
|
||||||
|
{
|
||||||
|
// Start is called before the first frame update
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: efa839f070de80947a96cae9774ce7e9
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -9,40 +9,25 @@ public class ToolAndmaterialMgr : BaseManager<ToolAndmaterialMgr>
|
||||||
{
|
{
|
||||||
//该系统所需要使用的全部工器具和材料
|
//该系统所需要使用的全部工器具和材料
|
||||||
|
|
||||||
public List<TB_ToolAndMaterial> toolAndMaterialList;
|
public List<D_ToolAndMaterialData> toolAndMaterialList = new List<D_ToolAndMaterialData>();
|
||||||
|
|
||||||
private ToolAndmaterialMgr()
|
private ToolAndmaterialMgr()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
//public void Init()
|
public void Init(string toolOrMaterilOrDevice)
|
||||||
//{
|
|
||||||
// toolAndMaterialList = GameManager.DataMgr.GetCurrentSystemToolAndMaterials();
|
|
||||||
//}
|
|
||||||
|
|
||||||
public string GetIconSpriteName(string objName)
|
|
||||||
{
|
{
|
||||||
var tempObj= toolAndMaterialList.Find(o => o.objName == objName);
|
toolAndMaterialList = GameManager.DataMgr.GetCurrentSystemToolAndMaterials(toolOrMaterilOrDevice);
|
||||||
if (tempObj!=null)
|
|
||||||
{
|
|
||||||
return tempObj.iconSpriteName;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetObjType(string objName)
|
|
||||||
|
public D_ToolAndMaterialData GetToolOrMaterialOrDeviceInfoByObjName(string objName)
|
||||||
{
|
{
|
||||||
var tempObj= toolAndMaterialList.Find(o => o.objName == objName);
|
for (int i = 0; i < toolAndMaterialList.Count; i++)
|
||||||
if (tempObj!=null)
|
|
||||||
{
|
{
|
||||||
return tempObj.type;
|
if (toolAndMaterialList[i].objName == objName)
|
||||||
}
|
return toolAndMaterialList[i];
|
||||||
else
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -10,6 +10,7 @@ public class Device_Mobile : MonoBehaviour
|
||||||
public int downIndex = 0;
|
public int downIndex = 0;
|
||||||
public int triggerID = 5005;
|
public int triggerID = 5005;
|
||||||
private HighlightEffect _highlight;
|
private HighlightEffect _highlight;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
_highlight = GetComponent<HighlightEffect>();
|
_highlight = GetComponent<HighlightEffect>();
|
||||||
|
|
|
@ -14,10 +14,7 @@ public class ItemInfo
|
||||||
public int toolId;
|
public int toolId;
|
||||||
public int triggerID;
|
public int triggerID;
|
||||||
public string toolName;
|
public string toolName;
|
||||||
|
|
||||||
public E_ToolOrDeviceOrMaterials toolOrDeviceOrMaterial;
|
public E_ToolOrDeviceOrMaterials toolOrDeviceOrMaterial;
|
||||||
|
|
||||||
// 你可以在这里添加更多的属性和方法
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工具或者材料基类,此脚本必须挂在工具或者材料上
|
/// 工具或者材料基类,此脚本必须挂在工具或者材料上
|
||||||
|
@ -25,64 +22,37 @@ public class ItemInfo
|
||||||
public abstract class BaseToolOrDevice : MonoBehaviour
|
public abstract class BaseToolOrDevice : MonoBehaviour
|
||||||
{
|
{
|
||||||
public ItemInfo itemInfo;
|
public ItemInfo itemInfo;
|
||||||
|
[HideInInspector]
|
||||||
public HighlightEffect _highlight;
|
public HighlightEffect _highlight;
|
||||||
public bool IsClick = true;
|
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
_highlight = GetComponent<HighlightEffect>();
|
_highlight = GetComponent<HighlightEffect>();
|
||||||
|
GetInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[ContextMenu("GetInfo")]
|
public void GetInfo()
|
||||||
public void GetInfo(string itemName)
|
|
||||||
{
|
{
|
||||||
|
D_ToolAndMaterialData dTMD = GameManager.ToolAndmaterialMgr.GetToolOrMaterialOrDeviceInfoByObjName(gameObject.name);
|
||||||
|
if (dTMD != null)
|
||||||
|
{
|
||||||
|
itemInfo.toolId = dTMD.id;
|
||||||
|
itemInfo.triggerID = dTMD.id;
|
||||||
|
itemInfo.toolOrDeviceOrMaterial = (E_ToolOrDeviceOrMaterials)dTMD.type;
|
||||||
|
gameObject.SetActive(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gameObject.SetActive(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//public void GetInfo(string itemName)
|
|
||||||
//{
|
|
||||||
// if (itemDatabase.ContainsKey(itemName))
|
|
||||||
// {
|
|
||||||
// ItemInfo info = itemDatabase[itemName];
|
|
||||||
// OnItemInfoReceived?.Invoke(info);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//public void GetInfo(GameObject Item,string ItemName,E_ToolOrDeviceOrMaterials E_Item)
|
|
||||||
//{
|
|
||||||
|
|
||||||
// Item.SetActive(false);
|
|
||||||
// if (itemDatabase.ContainsKey(ItemName))
|
|
||||||
// {
|
|
||||||
// // 获取物品信息
|
|
||||||
// ItemInfo info = itemDatabase[ItemName];
|
|
||||||
// // TODO: 后续处理,例如更新UI或执行其他逻辑
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// Debug.LogWarning($"物品 '{ItemName}' 不存在于数据库中");
|
|
||||||
// }
|
|
||||||
// switch (E_Item)
|
|
||||||
// {
|
|
||||||
// case E_ToolOrDeviceOrMaterials.Tool:
|
|
||||||
|
|
||||||
// break;
|
|
||||||
// case E_ToolOrDeviceOrMaterials.Materials:
|
|
||||||
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// //TODO:后续 根据英文名称去获取ID 中文名 和其它
|
|
||||||
//}
|
|
||||||
|
|
||||||
private void OnMouseEnter()
|
private void OnMouseEnter()
|
||||||
{
|
{
|
||||||
if (GameManager.RunModelMgr.SceneType != E_SceneType.ToolRoom) return;
|
if (GameManager.RunModelMgr.SceneType != E_SceneType.ToolRoom) return;
|
||||||
if (EventSystem.current.IsPointerOverGameObject()) return;
|
if (EventSystem.current.IsPointerOverGameObject()) return;
|
||||||
OnEnter();
|
OnEnter();
|
||||||
UIManager.Instance.ShowPanel<ItemTips>(E_UI_Layer.System, (panel) =>
|
|
||||||
{
|
|
||||||
panel.Init(gameObject.name);
|
|
||||||
}); //提示面板
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnMouseDown()
|
private void OnMouseDown()
|
||||||
|
@ -90,16 +60,13 @@ public abstract class BaseToolOrDevice : MonoBehaviour
|
||||||
if (GameManager.RunModelMgr.SceneType != E_SceneType.ToolRoom) return;
|
if (GameManager.RunModelMgr.SceneType != E_SceneType.ToolRoom) return;
|
||||||
if (EventSystem.current.IsPointerOverGameObject()) return;
|
if (EventSystem.current.IsPointerOverGameObject()) return;
|
||||||
OnDown();
|
OnDown();
|
||||||
//gameObject.SetActive(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnMouseExit()
|
private void OnMouseExit()
|
||||||
{
|
{
|
||||||
UIManager.Instance.HidePanel<ItemTips>();//提示面板
|
|
||||||
//TODO: 这里写提示关闭的代码
|
|
||||||
if (GameManager.RunModelMgr.SceneType != E_SceneType.ToolRoom) return;
|
if (GameManager.RunModelMgr.SceneType != E_SceneType.ToolRoom) return;
|
||||||
if (EventSystem.current.IsPointerOverGameObject()) return;
|
|
||||||
OnExit();
|
OnExit();
|
||||||
|
if (EventSystem.current.IsPointerOverGameObject()) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,28 +7,32 @@ public class Tool_SelectComponent : BaseToolOrDevice
|
||||||
public override void OnEnter()
|
public override void OnEnter()
|
||||||
{
|
{
|
||||||
base.OnEnter();
|
base.OnEnter();
|
||||||
|
GameManager.UIMgr.ShowPanel<ItemTips>(E_UI_Layer.System, (panel) =>
|
||||||
|
{
|
||||||
|
panel.Init(gameObject.name);
|
||||||
|
});
|
||||||
///高亮
|
///高亮
|
||||||
_highlight.highlighted = true;
|
_highlight.highlighted = true;
|
||||||
}
|
}
|
||||||
public override void OnDown()
|
public override void OnDown()
|
||||||
{
|
{
|
||||||
base.OnDown();
|
base.OnDown();
|
||||||
if (GameManager.RunModelMgr.SceneType == E_SceneType.ToolRoom)//털뙤끝쒼
|
////렴흙교관
|
||||||
|
//묏야츰냔뵨묏야렴흙묏야움
|
||||||
|
|
||||||
|
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(itemInfo.triggerID, true) == 0)
|
||||||
{
|
{
|
||||||
////렴흙교관
|
GameManager.PacksackBagMgr.AddOneToolOrMater(itemInfo);
|
||||||
if (IsClick)
|
gameObject.SetActive(false);
|
||||||
{
|
GameManager.UIMgr.HidePanel<ItemTips>();//瓊刻충겼
|
||||||
//묏야츰냔뵨묏야렴흙묏야움
|
|
||||||
GameManager.PacksackBagMgr.AddOneToolOrMater(itemInfo);
|
|
||||||
this.gameObject.SetActive(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnExit()
|
public override void OnExit()
|
||||||
{
|
{
|
||||||
///关闭高亮
|
///关闭高亮
|
||||||
_highlight.highlighted = false;
|
|
||||||
base.OnExit();
|
base.OnExit();
|
||||||
|
_highlight.highlighted = false;
|
||||||
|
GameManager.UIMgr.HidePanel<ItemTips>();//瓊刻충겼
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class UI_MenuBar : BasePanel
|
||||||
private Coroutine coroutine;
|
private Coroutine coroutine;
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
coroutine = GameManager.MonoMgr.StartCoroutine(CountDown(countDown));
|
//coroutine = GameManager.MonoMgr.StartCoroutine(CountDown(countDown));
|
||||||
//MenuBarIamge = GetControl<Image>("MenuBar");
|
//MenuBarIamge = GetControl<Image>("MenuBar");
|
||||||
closeDefaultBtn = GetControl<Button>("CloseDefaultBtn");
|
closeDefaultBtn = GetControl<Button>("CloseDefaultBtn");
|
||||||
toolRoomBtn = GetControl<Button>("ToolRoomBtn");
|
toolRoomBtn = GetControl<Button>("ToolRoomBtn");
|
||||||
|
@ -64,6 +64,7 @@ public class UI_MenuBar : BasePanel
|
||||||
public void CheckBtnBySceneName(E_SceneType type)
|
public void CheckBtnBySceneName(E_SceneType type)
|
||||||
{
|
{
|
||||||
Debug.Log(type.ToString());
|
Debug.Log(type.ToString());
|
||||||
|
GetControl<Image>("MenuBar").transform.DOLocalMoveX(1070, 0.5f);
|
||||||
toolRoomBtn.gameObject.SetActive(type != E_SceneType.ToolRoom);
|
toolRoomBtn.gameObject.SetActive(type != E_SceneType.ToolRoom);
|
||||||
siteBtn.gameObject.SetActive(type == E_SceneType.ToolRoom);
|
siteBtn.gameObject.SetActive(type == E_SceneType.ToolRoom);
|
||||||
workOrderBtn.gameObject.SetActive(type == E_SceneType.Office || type == E_SceneType.Site);
|
workOrderBtn.gameObject.SetActive(type == E_SceneType.Office || type == E_SceneType.Site);
|
||||||
|
@ -112,11 +113,12 @@ public class UI_MenuBar : BasePanel
|
||||||
GameManager.ScenesMgr.LoadSceneAsyn("04_ToolMaterialScene", () =>
|
GameManager.ScenesMgr.LoadSceneAsyn("04_ToolMaterialScene", () =>
|
||||||
{
|
{
|
||||||
GameManager.EventMgr.EventTrigger<float>(Enum_EventType.UpdateProgress, 0.9f);
|
GameManager.EventMgr.EventTrigger<float>(Enum_EventType.UpdateProgress, 0.9f);
|
||||||
|
GameManager.EventMgr.EventTrigger(Enum_EventType.SwitchScene, GameManager.RunModelMgr.SceneType);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "SiteBtn":
|
case "SiteBtn":
|
||||||
SceneManager.LoadScene("");
|
|
||||||
break;
|
break;
|
||||||
case "WorkOrderBtn":
|
case "WorkOrderBtn":
|
||||||
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(workOrderID, false) == 0)
|
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(workOrderID, false) == 0)
|
||||||
|
@ -139,6 +141,12 @@ public class UI_MenuBar : BasePanel
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "ToolKitBtn":
|
||||||
|
GameManager.UIMgr.ShowPanel<UI_ToolAndMaterialPanel>(E_UI_Layer.Mid, (p) =>
|
||||||
|
{
|
||||||
|
|
||||||
|
});
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,8 +71,8 @@ public class UI_SelectDevicePanel : BasePanel
|
||||||
});
|
});
|
||||||
deviceBtnAComponent.onClick.AddListener(() =>
|
deviceBtnAComponent.onClick.AddListener(() =>
|
||||||
{
|
{
|
||||||
GameManager.RunModelMgr.deviceId = int.Parse(deviceBtnAComponent.name);
|
GameManager.RunModelMgr.schemeID = int.Parse(deviceBtnAComponent.name);
|
||||||
GameManager.ProcessMgr.Init(GameManager.RunModelMgr.deviceId, E_ModeType.Study);
|
GameManager.ProcessMgr.Init(GameManager.RunModelMgr.schemeID, E_ModeType.Study);
|
||||||
GameManager.UIMgr.ShowPanel<UI_LoadingPanel>(E_UI_Layer.System, (panel) =>
|
GameManager.UIMgr.ShowPanel<UI_LoadingPanel>(E_UI_Layer.System, (panel) =>
|
||||||
{
|
{
|
||||||
GameManager.UIMgr.ShowPanel<UI_MainTitlePanel>(E_UI_Layer.Bot, (panel) =>
|
GameManager.UIMgr.ShowPanel<UI_MainTitlePanel>(E_UI_Layer.Bot, (panel) =>
|
||||||
|
|
|
@ -6,6 +6,7 @@ public class UI_ToolAndMaterialPanel : BasePanel
|
||||||
{
|
{
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue