右侧菜单
This commit is contained in:
parent
0dc2bdcc86
commit
c05176ffac
Assets
ArtRes/Excel
Scripts
Project
Enum
Manager
UI/UI_Panel
ProjectBase/EventCenter
Binary file not shown.
|
@ -1,7 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: bbaeff621a49deb45b058390ad6519c5
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
|
@ -144,4 +144,22 @@ public enum E_MessageType
|
||||||
/// 错误
|
/// 错误
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Error,
|
Error,
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum E_SceneType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 办公室
|
||||||
|
/// </summary>
|
||||||
|
Office,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 工器具间
|
||||||
|
/// </summary>
|
||||||
|
TooLRoom,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 现场
|
||||||
|
/// </summary>
|
||||||
|
Site,
|
||||||
}
|
}
|
|
@ -32,7 +32,7 @@ public class DataManager : BaseManager<DataManager>
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 虚拟仿真系统
|
/// 虚拟仿真系统
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private Dictionary<int,TB_System> systemDic =new Dictionary<int, TB_System>();
|
private Dictionary<int, TB_System> systemDic = new Dictionary<int, TB_System>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备类型
|
/// 设备类型
|
||||||
|
@ -52,7 +52,7 @@ public class DataManager : BaseManager<DataManager>
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化
|
/// 初始化
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
schemeDic = GameManager.BinaryMgr.GetTable<TB_SchemeContainer>().dataDic;
|
schemeDic = GameManager.BinaryMgr.GetTable<TB_SchemeContainer>().dataDic;
|
||||||
processDic = GameManager.BinaryMgr.GetTable<TB_ProcessContainer>().dataDic;
|
processDic = GameManager.BinaryMgr.GetTable<TB_ProcessContainer>().dataDic;
|
||||||
|
@ -68,7 +68,7 @@ public class DataManager : BaseManager<DataManager>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public D_Scheme GetSchemeData(int id)
|
public D_Scheme GetSchemeData(int id)
|
||||||
{
|
{
|
||||||
D_Scheme d_Scheme = new D_Scheme();
|
D_Scheme d_Scheme = new D_Scheme();
|
||||||
//获取方案数据
|
//获取方案数据
|
||||||
|
@ -86,7 +86,7 @@ public class DataManager : BaseManager<DataManager>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="schemeId"></param>
|
/// <param name="schemeId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private List<D_Process> GetD_Processes(int schemeId)
|
private List<D_Process> GetD_Processes(int schemeId)
|
||||||
{
|
{
|
||||||
List<D_Process> d_Processes = new List<D_Process>();
|
List<D_Process> d_Processes = new List<D_Process>();
|
||||||
//获取方案流程数据
|
//获取方案流程数据
|
||||||
|
@ -114,7 +114,7 @@ public class DataManager : BaseManager<DataManager>
|
||||||
public List<D_SubProcess> GetD_SubProcesses(int schemeId, int processId)
|
public List<D_SubProcess> GetD_SubProcesses(int schemeId, int processId)
|
||||||
{
|
{
|
||||||
List<D_SubProcess> d_SubProcesses = new List<D_SubProcess>();
|
List<D_SubProcess> d_SubProcesses = new List<D_SubProcess>();
|
||||||
foreach(var item in subProcessDic.Values)
|
foreach (var item in subProcessDic.Values)
|
||||||
{
|
{
|
||||||
if (item.schemeId == schemeId && item.processId == processId)
|
if (item.schemeId == schemeId && item.processId == processId)
|
||||||
{
|
{
|
||||||
|
@ -140,10 +140,10 @@ public class DataManager : BaseManager<DataManager>
|
||||||
/// <param name="processId"></param>
|
/// <param name="processId"></param>
|
||||||
/// <param name="subProcessStepId"></param>
|
/// <param name="subProcessStepId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private List<D_SubProcessStep> GetD_SubProcessSteps(int schemeId, int processId,int subProcessId)
|
private List<D_SubProcessStep> GetD_SubProcessSteps(int schemeId, int processId, int subProcessId)
|
||||||
{
|
{
|
||||||
List<D_SubProcessStep> d_SubProcessSteps = new List<D_SubProcessStep>();
|
List<D_SubProcessStep> d_SubProcessSteps = new List<D_SubProcessStep>();
|
||||||
foreach(var step in subProcessStepDic.Values)
|
foreach (var step in subProcessStepDic.Values)
|
||||||
{
|
{
|
||||||
if (step.schemeId == schemeId && step.processId == processId && step.subProcessId == subProcessId)
|
if (step.schemeId == schemeId && step.processId == processId && step.subProcessId == subProcessId)
|
||||||
{
|
{
|
||||||
|
@ -167,20 +167,20 @@ public class DataManager : BaseManager<DataManager>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="systemId"></param>
|
/// <param name="systemId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public TB_System GetSystemInfo(int systemId)
|
public TB_System GetSystemInfo(int systemId)
|
||||||
{
|
{
|
||||||
if (systemDic.ContainsKey(systemId))
|
if (systemDic.ContainsKey(systemId))
|
||||||
{
|
{
|
||||||
return systemDic[systemId];
|
return systemDic[systemId];
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取报告
|
/// 获取报告
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
public R_Scheme GetSchemeReport(int id)
|
public R_Scheme GetSchemeReport(int id)
|
||||||
{
|
{
|
||||||
R_Scheme r_Scheme = new R_Scheme();
|
R_Scheme r_Scheme = new R_Scheme();
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 맏得묏야꼼죕관밗잿
|
/// 负责工具材料包管理
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PacksackBagMgr : BaseManager<PacksackBagMgr>
|
public class PacksackBagMgr : BaseManager<PacksackBagMgr>
|
||||||
{
|
{
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class ProcessManager : BaseManager<ProcessManager>
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 倒计时
|
/// 倒计时
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="time"></param>
|
/// <param name="time">倒计时多久</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private IEnumerator CountDown(int time)
|
private IEnumerator CountDown(int time)
|
||||||
{
|
{
|
||||||
|
@ -118,7 +118,6 @@ public class ProcessManager : BaseManager<ProcessManager>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 结束
|
/// 结束
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 正在使用的工具/材料管理类
|
/// 正在使用的工具/材料管理类
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ToolAndmaterialMgr : BaseManager<ToolAndmaterialMgr>
|
public class ToolAndmaterialMgr : BaseManager<ToolAndmaterialMgr>
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,91 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
/// <summary>
|
||||||
|
/// 右侧菜单按钮
|
||||||
|
/// </summary>
|
||||||
|
public class UI_MenuPanel : BasePanel
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 存储创建出来的btn
|
||||||
|
/// </summary>
|
||||||
|
private List<GameObject> itemObjs =new List<GameObject>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 初始化
|
||||||
|
/// </summary>
|
||||||
|
public void Init()
|
||||||
|
{
|
||||||
|
CreateMenuBtn(E_SceneType.Office);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建菜单按钮
|
||||||
|
/// 根据所属空间创建 对应的按钮,
|
||||||
|
/// 还需要根据需求设定是否激活
|
||||||
|
/// </summary>
|
||||||
|
private void CreateMenuBtn(E_SceneType type)
|
||||||
|
{
|
||||||
|
//清空已经穿件出来的
|
||||||
|
ClearMenuBtn();
|
||||||
|
//获取所在场景中的btn数据
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case E_SceneType.Office:
|
||||||
|
break;
|
||||||
|
case E_SceneType.TooLRoom:
|
||||||
|
break;
|
||||||
|
case E_SceneType.Site:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据所在场景 创建新的btn 并记录
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 清空创建出来的
|
||||||
|
/// </summary>
|
||||||
|
private void ClearMenuBtn()
|
||||||
|
{
|
||||||
|
if (itemObjs.Count == 0)
|
||||||
|
return;
|
||||||
|
for (int i = 0; i < itemObjs.Count; i++)
|
||||||
|
{
|
||||||
|
Destroy(itemObjs[i]);
|
||||||
|
}
|
||||||
|
itemObjs.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 显示面板
|
||||||
|
/// </summary>
|
||||||
|
public override void ShowMe()
|
||||||
|
{
|
||||||
|
GameManager.EventMgr.AddEventListener<E_SceneType>(Enum_EventType.SwitchScene, CreateMenuBtn);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 隐藏面板
|
||||||
|
/// </summary>
|
||||||
|
public override void HideMe()
|
||||||
|
{
|
||||||
|
GameManager.EventMgr.RemoveEventListener<E_SceneType>(Enum_EventType.SwitchScene, CreateMenuBtn);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 按钮点击
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="btnName"></param>
|
||||||
|
protected override void OnClick(string btnName)
|
||||||
|
{
|
||||||
|
switch (btnName)
|
||||||
|
{
|
||||||
|
case "":
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 3aa727d14c599074b9ab6651b6289055
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -27,7 +27,6 @@ public class UI_SelectModeOrDeviceTitlePanel : BasePanel
|
||||||
break;
|
break;
|
||||||
case E_ModeType.Exam:
|
case E_ModeType.Exam:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GetControl<Text>("Text_ModeType").text = mode;
|
GetControl<Text>("Text_ModeType").text = mode;
|
||||||
|
@ -81,12 +80,18 @@ public class UI_SelectModeOrDeviceTitlePanel : BasePanel
|
||||||
/// <param name="btnName"></param>
|
/// <param name="btnName"></param>
|
||||||
protected override void OnClick(string btnName)
|
protected override void OnClick(string btnName)
|
||||||
{
|
{
|
||||||
base.OnClick(btnName);
|
|
||||||
switch (btnName)
|
switch (btnName)
|
||||||
{
|
{
|
||||||
//TODO 退出提示框
|
//TODO 退出提示框
|
||||||
case "Btn_Quit":
|
case "Btn_Quit":
|
||||||
print("退出应用");
|
print("退出应用");
|
||||||
|
GameManager.UIMgr.ShowPanel<UI_MessagePanel>(E_UI_Layer.System, (panel) =>
|
||||||
|
{
|
||||||
|
panel.Init("提示", "确定退出应用吗?", E_MessageType.Warning, () =>
|
||||||
|
{
|
||||||
|
Application.Quit();
|
||||||
|
});
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,4 +22,9 @@ public enum Enum_EventType
|
||||||
/// 选择/切换模式
|
/// 选择/切换模式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
SwitchMode,
|
SwitchMode,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 切换场景
|
||||||
|
/// </summary>
|
||||||
|
SwitchScene,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue