右侧菜单

This commit is contained in:
liuyu 2024-08-02 17:55:23 +08:00
parent 0dc2bdcc86
commit c05176ffac
11 changed files with 145 additions and 23 deletions

Binary file not shown.

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: bbaeff621a49deb45b058390ad6519c5
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -145,3 +145,21 @@ public enum E_MessageType
/// </summary>
Error,
}
public enum E_SceneType
{
/// <summary>
/// 办公室
/// </summary>
Office,
/// <summary>
/// 工器具间
/// </summary>
TooLRoom,
/// <summary>
/// 现场
/// </summary>
Site,
}

View File

@ -32,7 +32,7 @@ public class DataManager : BaseManager<DataManager>
/// <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>
/// 设备类型
@ -114,7 +114,7 @@ public class DataManager : BaseManager<DataManager>
public List<D_SubProcess> GetD_SubProcesses(int schemeId, int processId)
{
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)
{
@ -140,10 +140,10 @@ public class DataManager : BaseManager<DataManager>
/// <param name="processId"></param>
/// <param name="subProcessStepId"></param>
/// <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>();
foreach(var step in subProcessStepDic.Values)
foreach (var step in subProcessStepDic.Values)
{
if (step.schemeId == schemeId && step.processId == processId && step.subProcessId == subProcessId)
{
@ -173,7 +173,7 @@ public class DataManager : BaseManager<DataManager>
{
return systemDic[systemId];
}
return null;
return null;
}
/// <summary>

View File

@ -2,7 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 맏得묏야꼼죕관밗잿
/// 负责工具材料包管理
/// </summary>
public class PacksackBagMgr : BaseManager<PacksackBagMgr>
{

View File

@ -104,7 +104,7 @@ public class ProcessManager : BaseManager<ProcessManager>
/// <summary>
/// 倒计时
/// </summary>
/// <param name="time"></param>
/// <param name="time">倒计时多久</param>
/// <returns></returns>
private IEnumerator CountDown(int time)
{
@ -118,7 +118,6 @@ public class ProcessManager : BaseManager<ProcessManager>
}
}
/// <summary>
/// 结束
/// </summary>

View File

@ -2,7 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 正在使用的工具/材料管理类
/// 正在使用的工具/材料管理类
/// </summary>
public class ToolAndmaterialMgr : BaseManager<ToolAndmaterialMgr>
{

View File

@ -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;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3aa727d14c599074b9ab6651b6289055
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -27,7 +27,6 @@ public class UI_SelectModeOrDeviceTitlePanel : BasePanel
break;
case E_ModeType.Exam:
break;
}
GetControl<Text>("Text_ModeType").text = mode;
@ -81,12 +80,18 @@ public class UI_SelectModeOrDeviceTitlePanel : BasePanel
/// <param name="btnName"></param>
protected override void OnClick(string btnName)
{
base.OnClick(btnName);
switch (btnName)
{
//TODO 退出提示框
case "Btn_Quit":
print("退出应用");
GameManager.UIMgr.ShowPanel<UI_MessagePanel>(E_UI_Layer.System, (panel) =>
{
panel.Init("提示", "确定退出应用吗?", E_MessageType.Warning, () =>
{
Application.Quit();
});
});
break;
}
}

View File

@ -22,4 +22,9 @@ public enum Enum_EventType
/// 选择/切换模式
/// </summary>
SwitchMode,
/// <summary>
/// 切换场景
/// </summary>
SwitchScene,
}