This commit is contained in:
commit
2991508c36
|
|
@ -8,6 +8,10 @@ using UnityEngine;
|
|||
/// </summary>
|
||||
public class OfficeManager : SingletonMono<OfficeManager>
|
||||
{
|
||||
public GameObject currentTool;
|
||||
public Transform spawnToolPos;
|
||||
public Transform tMDTips;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ÊÖ»ú
|
||||
|
|
@ -21,11 +25,17 @@ public class OfficeManager : SingletonMono<OfficeManager>
|
|||
//GameManager.EventMgr.AddEventListener(Enum_EventType.OfficeTimeLineOver, OfficeTimeLineOver);
|
||||
//GameManager.EventMgr.AddEventListener<bool>(Enum_EventType.PlayerCanMove, SwitchFirstPersonControllerMove);
|
||||
GameManager.EventMgr.AddEventListener(Enum_EventType.InitializationUI, InitializationUI);
|
||||
|
||||
GameManager.RunModelMgr.SceneType = E_SceneType.Site;
|
||||
|
||||
if (GameManager.RunModelMgr.ModeType == E_ModeType.Study)
|
||||
{
|
||||
GameManager.EventMgr.AddEventListener<int>(Enum_EventType.SwitchSubProcess, SwitchSubProcess);
|
||||
}
|
||||
|
||||
InitializationUI();
|
||||
|
||||
GameManager.EventMgr.AddEventListener<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, SetSpawnToolInfo);
|
||||
}
|
||||
|
||||
public void SwitchFirstPersonControllerMove(bool isMove)
|
||||
|
|
@ -97,6 +107,8 @@ public class OfficeManager : SingletonMono<OfficeManager>
|
|||
{
|
||||
//GameManager.EventMgr.RemoveEventListener(Enum_EventType.OfficeTimeLineOver, OfficeTimeLineOver);
|
||||
GameManager.EventMgr.RemoveEventListener(Enum_EventType.InitializationUI, InitializationUI);
|
||||
|
||||
GameManager.EventMgr.RemoveEventListener<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, SetSpawnToolInfo);
|
||||
//GameManager.EventMgr.RemoveEventListener<bool>(Enum_EventType.PlayerCanMove, SwitchFirstPersonControllerMove);
|
||||
if (GameManager.UIMgr.GetPanel<UI_MiddleTipPanel>())
|
||||
{
|
||||
|
|
@ -106,4 +118,56 @@ public class OfficeManager : SingletonMono<OfficeManager>
|
|||
//GameManager.EventMgr.RemoveEventListener<int>(Enum_EventType.SwitchSubProcess, SwitchSubProcess);
|
||||
}
|
||||
|
||||
//ÒÆÖ²ÓÚLiveSceneManager
|
||||
public void SetSpawnToolInfo(GameObject tool)
|
||||
{
|
||||
if (tool == null)
|
||||
return;
|
||||
currentTool = tool;
|
||||
currentTool.transform.parent = Camera.main.transform;
|
||||
currentTool.transform.localPosition = spawnToolPos.localPosition;
|
||||
currentTool.transform.localEulerAngles = spawnToolPos.localEulerAngles;
|
||||
if (currentTool.GetComponent<Tool_Base>())
|
||||
{
|
||||
currentTool.GetComponent<Tool_Base>().SetHeadPosAndEulerang(currentTool.transform.localPosition, currentTool.transform.localEulerAngles);
|
||||
currentTool.GetComponent<Tool_Base>().AddStartAction(() =>
|
||||
{
|
||||
tMDTips.gameObject.SetActive(false);
|
||||
});
|
||||
currentTool.GetComponent<Tool_Base>().AddEndAction(() =>
|
||||
{
|
||||
tMDTips.gameObject.SetActive(true);
|
||||
});
|
||||
}
|
||||
if (currentTool.GetComponent<Device_Base>())
|
||||
{
|
||||
currentTool.GetComponent<Device_Base>().SetHeadPosAndEulerang(currentTool.transform.localPosition, currentTool.transform.localEulerAngles);
|
||||
}
|
||||
tMDTips.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public void OnCheckSubProcess(bool ifdestroy = true)
|
||||
{
|
||||
if (currentTool != null)
|
||||
{
|
||||
if (tMDTips != null)
|
||||
tMDTips.gameObject.SetActive(false);
|
||||
if (ifdestroy)
|
||||
DestroyImmediate(currentTool);
|
||||
currentTool = null;
|
||||
GameManager.EventMgr.EventTrigger<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, null);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
if (currentTool != null)
|
||||
{
|
||||
Debug.Log("Escape");
|
||||
OnCheckSubProcess();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,28 +79,28 @@ public class UI_ToolOrMaterialsOrDeviceItem : BaseItem
|
|||
Destroy(gameObject);
|
||||
break;
|
||||
case "iconBtn":
|
||||
bool isWorkCard = currentItem.toolName.Equals("工作证") ? false : true;
|
||||
if (currentItem.toolName.Equals("工作证") && !LiveSceneManager.Instance.npcCustomController.isClose)
|
||||
{
|
||||
//bool isWorkCard = currentItem.toolName.Equals("工作证") ? false : true;
|
||||
//if (currentItem.toolName.Equals("工作证") && !LiveSceneManager.Instance.npcCustomController.isClose)
|
||||
//{
|
||||
|
||||
if (GameManager.UIMgr.GetPanel<UI_MiddleTipPanel>() != null)
|
||||
GameManager.UIMgr.GetPanel<UI_MiddleTipPanel>().Init("提示:请移动到交互对象附近");
|
||||
if (GameManager.UIMgr.GetPanel<UI_MiddleTipPanel>() == null)
|
||||
{
|
||||
GameManager.UIMgr.ShowPanel<UI_MiddleTipPanel>(E_UI_Layer.System, (p) =>
|
||||
{
|
||||
p.Init($"提示:请移动到交互对象附近");
|
||||
});
|
||||
}
|
||||
// if (GameManager.UIMgr.GetPanel<UI_MiddleTipPanel>() != null)
|
||||
// GameManager.UIMgr.GetPanel<UI_MiddleTipPanel>().Init("提示:请移动到交互对象附近");
|
||||
// if (GameManager.UIMgr.GetPanel<UI_MiddleTipPanel>() == null)
|
||||
// {
|
||||
// GameManager.UIMgr.ShowPanel<UI_MiddleTipPanel>(E_UI_Layer.System, (p) =>
|
||||
// {
|
||||
// p.Init($"提示:请移动到交互对象附近");
|
||||
// });
|
||||
GameManager.EventMgr?.EventTrigger<bool>(Enum_EventType.PlayerCanMove, true);
|
||||
return;
|
||||
}
|
||||
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(currentItem.toolName, isWorkCard) == 0)
|
||||
{
|
||||
// }
|
||||
// //GameManager.UIMgr.ShowPanel<UI_MiddleTipPanel>(E_UI_Layer.System, (p) =>
|
||||
// //{
|
||||
// // p.Init($"提示:请移动到交互对象附近");
|
||||
// //});
|
||||
// GameManager.EventMgr?.EventTrigger<bool>(Enum_EventType.PlayerCanMove, true);
|
||||
// return;
|
||||
//}
|
||||
//if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(currentItem.toolName, isWorkCard) == 0)
|
||||
//{
|
||||
GameManager.UIMgr.HidePanel<UI_ToolAndMaterialPanel>();
|
||||
GameObject currentTool = Instantiate(currentItem.objPrefab);
|
||||
currentTool.GetComponent<BaseToolOrDevice>().enabled = false;
|
||||
|
|
@ -109,7 +109,7 @@ public class UI_ToolOrMaterialsOrDeviceItem : BaseItem
|
|||
GameManager.EventMgr.EventTrigger<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, currentTool);
|
||||
if (currentTool.name != "电能表校验仪器")
|
||||
GameManager.UIMgr.imageTips.HideTips();
|
||||
}
|
||||
//}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -314,10 +314,10 @@ public class UI_MenuBar : BasePanel
|
|||
}
|
||||
break;
|
||||
case "ToolKitBtn":
|
||||
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(toolKitName, true) == 0)
|
||||
{
|
||||
//if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(toolKitName, true) == 0)
|
||||
//{
|
||||
GameManager.UIMgr.ShowPanel<UI_ToolAndMaterialPanel>(E_UI_Layer.Mid);
|
||||
}
|
||||
//}
|
||||
break;
|
||||
case "NotifyBtn":
|
||||
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(notifyName, false) == 0)
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ public class UI_TaskListPanel : BasePanel
|
|||
|
||||
public void Init(int subProcessID)
|
||||
{
|
||||
rePractice.SetActive(GameManager.RunModelMgr.ModeType == E_ModeType.Practice);
|
||||
reStudy.SetActive(GameManager.RunModelMgr.ModeType == E_ModeType.Study);
|
||||
//rePractice.SetActive(GameManager.RunModelMgr.ModeType == E_ModeType.Practice);
|
||||
//reStudy.SetActive(GameManager.RunModelMgr.ModeType == E_ModeType.Study);
|
||||
taskListScrollView.SetActive(GameManager.RunModelMgr.ModeType == E_ModeType.Study);
|
||||
GetControl<Button>("BackBtn").gameObject.SetActive(GameManager.RunModelMgr.ModeType != E_ModeType.Exam);
|
||||
if (GameManager.RunModelMgr.ModeType == E_ModeType.Study)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class UI_ToolAndMaterialPanel : BasePanel
|
|||
CreatItem(E_ToolOrDeviceOrMaterials.Tool); //默认打开显示工器具
|
||||
if (GameManager.RunModelMgr.ModeType == E_ModeType.Study)
|
||||
{
|
||||
GetControl<Button>("closeBtn").gameObject.SetActive(false);
|
||||
//GetControl<Button>("closeBtn").gameObject.SetActive(false);
|
||||
GameManager.EventMgr.AddEventListener<string>(Enum_EventType.SwitchSubProcessStepTriggerID, SwitchSubProcessStepTriggerID);
|
||||
Debug.Log("注册高亮 UI_ToolAndMaterialPanel");
|
||||
//手动高亮
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<TB_System id="10002" systemName="酿酒高粱的形态特征及类型识别" loadName="酿酒高粱的形态特征及类型识别" titleName="酿酒高粱的形态特征及类型识别">
|
||||
|
||||
<Subject id="2002" deviceTypeId="20002" schemeName="酿酒高粱的形态特征及类型识别" deviceMap="单相表" isFault="0" schemeDes="" ToolOrMaterilOrDevice="剥线钳,绝缘螺丝刀,验电笔,国网安全帽,工作服,编织手套,绝缘靴,工作证,盒装封印,绝缘胶带,三相四线费控智能电能表">
|
||||
<Subject id="2002" deviceTypeId="20002" schemeName="酿酒高粱的形态特征及类型识别" deviceMap="单相表" isFault="0" schemeDes="" ToolOrMaterilOrDevice="剥线钳,绝缘螺丝刀">
|
||||
<Process id="" processName="观察高粱特征" processDes="">
|
||||
<Step id="" subProcessName="从老师处拿取工具" isPrecondition="FALSE" precondition="" tipTitle="" tips="">
|
||||
<operation id="" subProcessStepName="填写拆装工作单" isPrecondition="" precondition="Office" triggerID="拆装工单按钮" tipTitle="请填写拆装工作单" score=""></operation>
|
||||
|
|
|
|||
Loading…
Reference in New Issue