修复bug
This commit is contained in:
parent
6ccdb07928
commit
a0b04f7e3b
|
@ -3077,6 +3077,7 @@ MonoBehaviour:
|
|||
animatorParameters:
|
||||
target: {fileID: 1501092963}
|
||||
minDistance: 2
|
||||
isClose: 0
|
||||
--- !u!136 &890581131
|
||||
CapsuleCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -4753,6 +4754,7 @@ MonoBehaviour:
|
|||
animatorParameters: NPCState
|
||||
target: {fileID: 1501092963}
|
||||
minDistance: 2
|
||||
isClose: 0
|
||||
--- !u!4 &1198127457
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -6310,6 +6312,7 @@ MonoBehaviour:
|
|||
spawnToolPos: {fileID: 1927580343}
|
||||
tMDTips: {fileID: 1180096483}
|
||||
triggerName: "\u6536\u56DE\u5DE5\u5177"
|
||||
npcCustomController: {fileID: 890581130}
|
||||
device_Control: {fileID: 1723332379}
|
||||
--- !u!4 &2109812127
|
||||
Transform:
|
||||
|
|
|
@ -44,7 +44,7 @@ public class StepState_1002 : StepState
|
|||
/// <param name="num"></param>
|
||||
public override void SetStepState(int num, int lastNum)
|
||||
{
|
||||
Debug.Log("切换步骤"+num);
|
||||
Debug.Log("切换步骤" + num);
|
||||
//删除手里的东西
|
||||
LiveSceneManager.Instance?.OnCheckSubProcess();
|
||||
|
||||
|
@ -52,20 +52,24 @@ public class StepState_1002 : StepState
|
|||
{
|
||||
//查看任务单
|
||||
OfficeManager.Instance.mobileController.downIndex = 0;
|
||||
PacksackBagMgr.Instance.ClearAllData();
|
||||
}
|
||||
else if (num == 2)
|
||||
{
|
||||
//工作预约
|
||||
OfficeManager.Instance.mobileController.downIndex = 1;
|
||||
PacksackBagMgr.Instance.ClearAllData();
|
||||
}
|
||||
else if (num == 3)
|
||||
{
|
||||
//办理工作票
|
||||
OfficeManager.Instance.mobileController.downIndex = 2;
|
||||
PacksackBagMgr.Instance.ClearAllData();
|
||||
}
|
||||
else if (num == 4)
|
||||
{
|
||||
//填写装拆工单
|
||||
PacksackBagMgr.Instance.ClearAllData();
|
||||
}
|
||||
else if (num == 5)
|
||||
{
|
||||
|
@ -74,7 +78,7 @@ public class StepState_1002 : StepState
|
|||
|
||||
//清空背包
|
||||
PacksackBagMgr.Instance.ClearAllToolAndDiveceAndMaterial();
|
||||
|
||||
TooRoomMannger.Instance.CheckWearByWearDic();
|
||||
//完成第一步点击去工具间
|
||||
if (num == lastNum)
|
||||
{
|
||||
|
@ -93,8 +97,8 @@ public class StepState_1002 : StepState
|
|||
//选取工器具
|
||||
|
||||
//服装拿到背包
|
||||
List<Tool_SelectComponent> items=ToolAndmaterialMgr.Instance.GetItemInfoByName(new List<string> { "国网安全帽", "工作服", "绝缘手套", "绝缘靴" });
|
||||
items.ForEach(item =>
|
||||
List<Tool_SelectComponent> items = ToolAndmaterialMgr.Instance.GetItemInfoByName(new List<string> { "国网安全帽", "工作服", "绝缘手套", "绝缘靴" });
|
||||
items.ForEach(item =>
|
||||
{
|
||||
PacksackBagMgr.Instance.AddOneToolOrMater(item.itemInfo);
|
||||
Destroy(item.gameObject);
|
||||
|
@ -129,9 +133,9 @@ public class StepState_1002 : StepState
|
|||
//清空背包数据
|
||||
PacksackBagMgr.Instance.ClearAllData();
|
||||
//生成服装
|
||||
List<ItemInfo> items=ToolAndmaterialMgr.Instance.CreateItemInfoByName(new List<string> { "国网安全帽", "工作服", "绝缘手套", "绝缘靴" });
|
||||
List<ItemInfo> items = ToolAndmaterialMgr.Instance.CreateItemInfoByName(new List<string> { "国网安全帽", "工作服", "绝缘手套", "绝缘靴" });
|
||||
//放入背包
|
||||
items.ForEach(item =>
|
||||
items.ForEach(item =>
|
||||
{
|
||||
PacksackBagMgr.Instance.AddOneToolOrMater(item);
|
||||
//穿上
|
||||
|
@ -139,7 +143,7 @@ public class StepState_1002 : StepState
|
|||
});
|
||||
//生成工具
|
||||
List<ItemInfo> items2 = ToolAndmaterialMgr.Instance.CreateItemInfoByName(new List<string> { "剥线钳", "绝缘螺丝刀", "验电笔", "工作证", "盒装封印", "绝缘胶带", "三相四线电能表" });
|
||||
items2.ForEach(item =>
|
||||
items2.ForEach(item =>
|
||||
{
|
||||
PacksackBagMgr.Instance.AddOneToolOrMater(item);
|
||||
});
|
||||
|
@ -150,9 +154,9 @@ public class StepState_1002 : StepState
|
|||
device_Control.Init();
|
||||
|
||||
//还原npc对话
|
||||
GameObject.FindObjectsOfType<NPCController>().ToList().ForEach(a =>
|
||||
GameObject.FindObjectsOfType<NPCController>().ToList().ForEach(a =>
|
||||
{
|
||||
a.speackIndex = 0;
|
||||
a.speackIndex = 0;
|
||||
a.spriteRenderer.gameObject.SetActive(true);
|
||||
});
|
||||
}
|
||||
|
@ -161,7 +165,7 @@ public class StepState_1002 : StepState
|
|||
//班前会
|
||||
GameObject.FindObjectsOfType<NPCController>().ToList().Find(a => a.triggerName == "NPC客户").spriteRenderer.gameObject.SetActive(false);
|
||||
}
|
||||
else if (num == 9)
|
||||
else if (num == 9)
|
||||
{
|
||||
//接线检查
|
||||
|
||||
|
@ -171,12 +175,12 @@ public class StepState_1002 : StepState
|
|||
//还原npc负责人
|
||||
GameObject.FindObjectsOfType<NPCController>().ToList().ForEach(a =>
|
||||
{
|
||||
if(a.triggerName == "NPC负责人")
|
||||
if (a.triggerName == "NPC负责人")
|
||||
a.speackIndex = 1;
|
||||
a.spriteRenderer.gameObject.SetActive(false);
|
||||
});
|
||||
}
|
||||
else if(num == 10)
|
||||
else if (num == 10)
|
||||
{
|
||||
//断开电源并验电
|
||||
|
||||
|
@ -200,13 +204,13 @@ public class StepState_1002 : StepState
|
|||
//电源断开了
|
||||
device_Control.inSwitch.CloseState();
|
||||
}
|
||||
else if(num== 12)
|
||||
else if (num == 12)
|
||||
{
|
||||
//拆除电能计量装置
|
||||
//铭牌已读取
|
||||
device_Control.meteringDevice.namePlate.isChecked = true;
|
||||
}
|
||||
else if( num == 13)
|
||||
else if (num == 13)
|
||||
{
|
||||
//安装电能表
|
||||
|
||||
|
@ -221,7 +225,7 @@ public class StepState_1002 : StepState
|
|||
device_Control.jieXian_lines.ForEach(screw =>
|
||||
{
|
||||
screw.isConnected = false;
|
||||
screw.transform.localPosition = new Vector3(screw.transform.localPosition.x, screw.InstallPosY-2, screw.transform.localPosition.z);
|
||||
screw.transform.localPosition = new Vector3(screw.transform.localPosition.x, screw.InstallPosY - 2, screw.transform.localPosition.z);
|
||||
});
|
||||
//刷新带电状态
|
||||
device_Control.CheckHasElectricity();
|
||||
|
@ -250,7 +254,7 @@ public class StepState_1002 : StepState
|
|||
//刷新带电状态
|
||||
device_Control.CheckHasElectricity();
|
||||
}
|
||||
else if(num== 15)
|
||||
else if (num == 15)
|
||||
{
|
||||
//现场通电及检查
|
||||
|
||||
|
@ -258,7 +262,7 @@ public class StepState_1002 : StepState
|
|||
device_Control.check_JieXian.isChecked = true;
|
||||
device_Control.check_JieXian.GetComponent<BoxCollider>().enabled = false;
|
||||
}
|
||||
else if(num== 16)
|
||||
else if (num == 16)
|
||||
{
|
||||
//实施封印
|
||||
|
||||
|
@ -267,13 +271,13 @@ public class StepState_1002 : StepState
|
|||
//盖子盖上
|
||||
device_Control.meteringDevice.CoverInstallState();
|
||||
}
|
||||
else if(num== 17)
|
||||
else if (num == 17)
|
||||
{
|
||||
//填写告知单
|
||||
device_Control.meteringDevice.cover.cover_seal_Left.Install();
|
||||
device_Control.meteringDevice.cover.cover_seal_Right.Install();
|
||||
}
|
||||
else if(num== 18)
|
||||
else if (num == 18)
|
||||
{
|
||||
//清理现场
|
||||
}
|
||||
|
|
|
@ -173,7 +173,7 @@ public class GameManager : SingletonAutoMono<GameManager>
|
|||
});
|
||||
}
|
||||
/// <summary>
|
||||
///返回模式选择界面
|
||||
///首次加载和返回模式选择界面
|
||||
/// </summary>
|
||||
/// <param name="isReset"></param>
|
||||
public void ShowUIPanelAndLoadScene(bool isReset = false)
|
||||
|
@ -196,7 +196,7 @@ public class GameManager : SingletonAutoMono<GameManager>
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 练习
|
||||
/// 练习,重新练习会调用
|
||||
/// </summary>
|
||||
public void Practice()
|
||||
{
|
||||
|
@ -206,11 +206,6 @@ public class GameManager : SingletonAutoMono<GameManager>
|
|||
ProcessMgr.Init(RunModelMgr.schemeID, RunModelMgr.ModeType);
|
||||
UIMgr.ShowPanel<UI_LoadingPanel>(E_UI_Layer.System, (panel) =>
|
||||
{
|
||||
UIMgr.ShowPanel<UI_MainTitlePanel>(E_UI_Layer.Bot, (panel) =>
|
||||
{
|
||||
panel.Init();
|
||||
});
|
||||
|
||||
panel.Init();
|
||||
EventMgr.EventTrigger<float>(Enum_EventType.UpdateProgress, 0.1f);
|
||||
ScenesMgr.LoadSceneAsyn($"{systemId}_{RunModelMgr.schemeID}_03_OfficeScene", () =>
|
||||
|
@ -235,8 +230,10 @@ public class GameManager : SingletonAutoMono<GameManager>
|
|||
UIMgr.HidePanel<UI_TaskListPanel>();
|
||||
if (UIMgr.GetPanel<UI_MenuBar>())
|
||||
UIMgr.HidePanel<UI_MenuBar>();
|
||||
UIMgr.GetPanel<UI_MainTitlePanel>().ResetByModeType();
|
||||
PacksackBagMgr.ClearAllData();
|
||||
EventMgr.Clear();
|
||||
UIMgr.GetPanel<UI_MainTitlePanel>().ShowMe();
|
||||
ScoreManager.instance.ReInit();
|
||||
RunModelMgr.startTime = DateTime.Now;
|
||||
Debug.Log("重置开始时间");
|
||||
|
|
|
@ -12,6 +12,7 @@ public class LiveSceneManager : SingletonMono<LiveSceneManager>
|
|||
public Transform spawnToolPos;
|
||||
public Transform tMDTips;
|
||||
public string triggerName;
|
||||
public NPCController npcCustomController;
|
||||
|
||||
//场景中设备控制脚本
|
||||
public Device_Control device_Control;
|
||||
|
@ -38,6 +39,7 @@ public class LiveSceneManager : SingletonMono<LiveSceneManager>
|
|||
public void SetSpawnToolInfo(GameObject tool)
|
||||
{
|
||||
if (tool == null) return;
|
||||
|
||||
currentTool = tool;
|
||||
currentTool.transform.parent = Camera.main.transform;
|
||||
currentTool.transform.localPosition = spawnToolPos.localPosition;
|
||||
|
@ -57,12 +59,6 @@ public class LiveSceneManager : SingletonMono<LiveSceneManager>
|
|||
if (currentTool.GetComponent<Device_Base>())
|
||||
{
|
||||
currentTool.GetComponent<Device_Base>().SetHeadPosAndEulerang(currentTool.transform.localPosition, currentTool.transform.localEulerAngles);
|
||||
currentTool.GetComponent<Device_Base>().AddStartAction(() =>
|
||||
{
|
||||
});
|
||||
currentTool.GetComponent<Device_Base>().AddEndAction(() =>
|
||||
{
|
||||
});
|
||||
}
|
||||
tMDTips.gameObject.SetActive(true);
|
||||
if (currentTool.name.Equals("工作证"))
|
||||
|
|
|
@ -76,10 +76,10 @@ public class OfficeManager : SingletonMono<OfficeManager>
|
|||
if (!GameManager.UIMgr.GetPanel<UI_MenuBar>())
|
||||
{
|
||||
GameManager.UIMgr.ShowPanel<UI_MenuBar>(E_UI_Layer.Mid, (panel) =>
|
||||
{
|
||||
panel.Init();
|
||||
GameManager.EventMgr.EventTrigger(Enum_EventType.SwitchScene, GameManager.RunModelMgr.SceneType);
|
||||
});
|
||||
{
|
||||
panel.Init();
|
||||
GameManager.EventMgr.EventTrigger(Enum_EventType.SwitchScene, GameManager.RunModelMgr.SceneType);
|
||||
});
|
||||
}
|
||||
firstPersonController.gameObject.SetActive(true);
|
||||
}
|
||||
|
|
|
@ -158,7 +158,7 @@ public class ProcessManager : BaseManager<ProcessManager>
|
|||
{
|
||||
Debug.Log($"<color=red>完成所有</color>");
|
||||
//HQB 20240828完成后展示学习完成Tips
|
||||
GameManager.UIMgr.ShowPanel<UI_TipsForPracticePanel>(E_UI_Layer.System);
|
||||
GameManager.UIMgr.ShowPanel<UI_TipsForPracticePanel>(E_UI_Layer.Mid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,31 @@ public class TooRoomMannger : SingletonMono<TooRoomMannger>
|
|||
tmd.GetInfo();
|
||||
}
|
||||
RemoveRepeat();
|
||||
CheckWearByWearDic();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通过wearDic数据检测是否穿衣
|
||||
/// </summary>
|
||||
public void CheckWearByWearDic()
|
||||
{
|
||||
var wearData = GameManager.PacksackBagMgr.wearDic;
|
||||
if (wearData.Count > 0)
|
||||
{
|
||||
foreach (var item in wearData)
|
||||
{
|
||||
Wear(item.Key, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Wear("国网安全帽", false);
|
||||
Wear("工作服", false);
|
||||
Wear("绝缘手套", false);
|
||||
Wear("绝缘靴", false);
|
||||
}
|
||||
}
|
||||
|
||||
public void SwitchFirstPersonControllerMove(bool isMove)
|
||||
{
|
||||
firstPersonController.playerCanMove = isMove;
|
||||
|
@ -92,6 +116,14 @@ public class TooRoomMannger : SingletonMono<TooRoomMannger>
|
|||
}
|
||||
}
|
||||
|
||||
//public void ResetManWear()
|
||||
//{
|
||||
// headSlot.GetComponent<SkinnedMeshRenderer>().material = _cancel.SingleOrDefault(s => s.name == "国网安全帽");
|
||||
// bodySlot.GetComponent<SkinnedMeshRenderer>().material = _cancel.SingleOrDefault(s => s.name == "工作服");
|
||||
// handSlot.GetComponent<SkinnedMeshRenderer>().material = _cancel.SingleOrDefault(s => s.name == "绝缘手套");
|
||||
// shoesSlot.GetComponent<MeshRenderer>().material = _cancel.SingleOrDefault(s => s.name == "绝缘靴");
|
||||
//}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
GameManager.EventMgr.RemoveEventListener<bool>(Enum_EventType.PlayerCanMove, SwitchFirstPersonControllerMove);
|
||||
|
|
|
@ -24,6 +24,7 @@ public class MirrorController : PermanentTriggerBase
|
|||
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(triggerName, true) == 0)
|
||||
{
|
||||
GameManager.UIMgr.ShowPanel<UI_CheckMyselfPanel>(E_UI_Layer.Mid);
|
||||
_highlight.SetHighlighted(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ public class NPCController : PermanentTriggerBase
|
|||
/// <summary>
|
||||
/// 是否靠近
|
||||
/// </summary>
|
||||
private bool isClose = false;
|
||||
public bool isClose = false;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
using System;
|
||||
|
||||
public class UI_SubProcessItem : BaseItem
|
||||
{
|
||||
|
@ -10,6 +11,7 @@ public class UI_SubProcessItem : BaseItem
|
|||
public int subProcessID;
|
||||
public int subProcessStepID;
|
||||
public string warnnigTips;
|
||||
private Action cancelCallback;
|
||||
|
||||
public void Init(D_SubProcess d_SubProcess, int subProcessID)
|
||||
{
|
||||
|
@ -41,17 +43,20 @@ public class UI_SubProcessItem : BaseItem
|
|||
GetControl<Image>("learningTips").gameObject.SetActive(false);
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// 根据传进来得状态去切换重新学习或者切换步骤
|
||||
/// </summary>
|
||||
/// <param name="isReset"></param>
|
||||
/// <param name="isReset">true 是否重新学习 ,false 当前步骤还没有学完,确定要切换吗?</param>
|
||||
/// <param name="state">0 未完成所有步骤跳转,1 完成所有步骤跳转</param>
|
||||
public void OnResetClick(bool isReset, int state)
|
||||
/// cancelCallback :当完成所有得步骤之后,在弹出得界面上选择重新学习之后,弹出确认框,如果选择取消就需要该方法第三个参数入参
|
||||
public void OnResetClick(bool isReset, int state, Action _cancelCallback = null)
|
||||
{
|
||||
warnnigTips = isReset ? "是否重新学习?" : "当前步骤还没有学完,确定要切换吗?";
|
||||
if (state == 0)
|
||||
OnClick("subProcessBtn");
|
||||
else
|
||||
CheckSubProcess();
|
||||
if (_cancelCallback != null)
|
||||
cancelCallback += _cancelCallback;
|
||||
}
|
||||
protected override void OnClick(string btnName)
|
||||
{
|
||||
|
@ -68,6 +73,9 @@ public class UI_SubProcessItem : BaseItem
|
|||
break;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 是否重置学习或者跳步骤
|
||||
/// </summary>
|
||||
private void CheckSubProcess()
|
||||
{
|
||||
GameManager.UIMgr.ShowPanel<UI_MessagePanel>(E_UI_Layer.System, (p) =>
|
||||
|
@ -81,6 +89,9 @@ public class UI_SubProcessItem : BaseItem
|
|||
GameManager.EventMgr.EventTrigger<int>(Enum_EventType.SwitchSubProcess, subProcessID);
|
||||
//通知物体高亮
|
||||
GameManager.EventMgr.EventTrigger<string>(Enum_EventType.SwitchSubProcessStepTriggerID, ProcessManager.Instance.subProcessStepTriggerID);
|
||||
}, () =>
|
||||
{
|
||||
cancelCallback?.Invoke();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -64,6 +64,18 @@ public class UI_ToolOrMaterialsOrDeviceItem : BaseItem
|
|||
break;
|
||||
case "iconBtn":
|
||||
bool isWorkCard = currentItem.toolName.Equals("¹¤×÷Ö¤") ? false : true;
|
||||
if (GameManager.RunModelMgr.ModeType != E_ModeType.Study)
|
||||
{
|
||||
if (currentItem.toolName.Equals("工作证") && !LiveSceneManager.Instance.npcCustomController.isClose)
|
||||
{
|
||||
GameManager.UIMgr.ShowPanel<UI_MiddleTipPanel>(E_UI_Layer.System, (p) =>
|
||||
{
|
||||
p.Init($"提示:请靠近交互对象");
|
||||
});
|
||||
GameManager.EventMgr.EventTrigger<GameObject>(Enum_EventType.TakeOutAndRetrievingTheTools, null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID(currentItem.toolName, isWorkCard) == 0)
|
||||
{
|
||||
GameManager.UIMgr.HidePanel<UI_ToolAndMaterialPanel>();
|
||||
|
|
|
@ -16,7 +16,7 @@ public class UI_MainTitlePanel : BasePanel
|
|||
internal void Init()
|
||||
{
|
||||
SwitchTitleImg();
|
||||
SwitchMode();
|
||||
//SwitchMode();
|
||||
SwitchUserName();
|
||||
|
||||
}
|
||||
|
@ -27,14 +27,18 @@ public class UI_MainTitlePanel : BasePanel
|
|||
public override void ShowMe()
|
||||
{
|
||||
GameManager.EventMgr.AddEventListener(Enum_EventType.SwitchMode, SwitchMode);
|
||||
GameManager.EventMgr.AddEventListener(Enum_EventType.InitializationUI, InitializationUI);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 隐藏
|
||||
/// </summary>
|
||||
public override void HideMe()
|
||||
{
|
||||
GameManager.EventMgr.RemoveEventListener(Enum_EventType.SwitchMode, SwitchMode);
|
||||
GameManager.EventMgr.RemoveEventListener(Enum_EventType.InitializationUI, InitializationUI);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -58,14 +62,26 @@ public class UI_MainTitlePanel : BasePanel
|
|||
mode = "考试模式";
|
||||
break;
|
||||
}
|
||||
GetControl<Button>("upExamBtn").gameObject.SetActive(mode == "考试模式");
|
||||
GetControl<Button>("submitBtn").gameObject.SetActive(mode == "练习模式");
|
||||
GetControl<Image>("timeText").gameObject.SetActive(mode == "考试模式");
|
||||
///模式显示父物体
|
||||
GetControl<Image>("modelText").gameObject.SetActive(mode != "");
|
||||
//GetControl<Image>("userName").gameObject.SetActive(mode != string.Empty && mode != "学习模式");
|
||||
|
||||
///模式显示text
|
||||
GetControl<TextMeshProUGUI>("modelText (TMP)").text = mode;
|
||||
|
||||
}
|
||||
private void InitializationUI()
|
||||
{
|
||||
GetControl<Button>("upExamBtn").gameObject.SetActive(RunModelMgr.Instance.ModeType == E_ModeType.Exam);
|
||||
GetControl<Button>("submitBtn").gameObject.SetActive(RunModelMgr.Instance.ModeType == E_ModeType.Practice);
|
||||
//GetControl<Image>("timeText").gameObject.SetActive(RunModelMgr.Instance.ModeType == E_ModeType.Exam);
|
||||
Debug.LogError(RunModelMgr.Instance.ModeType.ToString());
|
||||
}
|
||||
|
||||
public void ResetByModeType()
|
||||
{
|
||||
GetControl<Button>("upExamBtn").gameObject.SetActive(false);
|
||||
GetControl<Button>("submitBtn").gameObject.SetActive(false);
|
||||
//GetControl<Button>("timeText").gameObject.SetActive(false);
|
||||
|
||||
}
|
||||
|
||||
|
@ -97,14 +113,16 @@ public class UI_MainTitlePanel : BasePanel
|
|||
GameManager.UIMgr.ShowPanel<UI_MessagePanel>(E_UI_Layer.System,
|
||||
(panel) =>
|
||||
{
|
||||
panel.Init("提示", "确定退出应用吗?", E_MessageType.Error, () =>
|
||||
{
|
||||
Debug.Log("退出");
|
||||
Application.Quit();
|
||||
}, () =>
|
||||
{
|
||||
Debug.Log("取消");
|
||||
});
|
||||
panel.Init("提示", "确定退出应用吗?", E_MessageType.Error,
|
||||
() =>
|
||||
{
|
||||
Debug.Log("退出");
|
||||
Application.Quit();
|
||||
},
|
||||
() =>
|
||||
{
|
||||
Debug.Log("取消");
|
||||
});
|
||||
});
|
||||
break;
|
||||
case "upExamBtn":
|
||||
|
|
|
@ -73,10 +73,10 @@ public class UI_SelectDevicePanel : BasePanel
|
|||
GameManager.ProcessMgr.Init(GameManager.RunModelMgr.schemeID, GameManager.RunModelMgr.ModeType);
|
||||
GameManager.UIMgr.ShowPanel<UI_LoadingPanel>(E_UI_Layer.System, (panel) =>
|
||||
{
|
||||
GameManager.UIMgr.ShowPanel<UI_MainTitlePanel>(E_UI_Layer.Bot, (panel) =>
|
||||
{
|
||||
panel.Init();
|
||||
});
|
||||
//GameManager.UIMgr.ShowPanel<UI_MainTitlePanel>(E_UI_Layer.Bot, (panel) =>
|
||||
//{
|
||||
// panel.Init();
|
||||
//});
|
||||
|
||||
panel.Init();
|
||||
GameManager.EventMgr.EventTrigger<float>(Enum_EventType.UpdateProgress, 0.1f);
|
||||
|
|
|
@ -7,8 +7,12 @@ public class UI_SelectModePanel : BasePanel
|
|||
/// <summary>
|
||||
/// 初始化
|
||||
/// </summary>
|
||||
public void Init()
|
||||
public void Init()
|
||||
{
|
||||
}
|
||||
public override void ShowMe()
|
||||
{
|
||||
base.ShowMe();
|
||||
GameManager.RunModelMgr.ModeType = E_ModeType.None;
|
||||
GameManager.EventMgr.EventTrigger(Enum_EventType.SwitchMode);
|
||||
}
|
||||
|
@ -19,7 +23,7 @@ public class UI_SelectModePanel : BasePanel
|
|||
/// <param name="btnName"></param>
|
||||
protected override void OnClick(string btnName)
|
||||
{
|
||||
var modeType = E_ModeType.None;
|
||||
var modeType = E_ModeType.None;
|
||||
switch (btnName)
|
||||
{
|
||||
case "StudyModelBtn":
|
||||
|
@ -32,9 +36,10 @@ public class UI_SelectModePanel : BasePanel
|
|||
GameManager.RunModelMgr.ModeType = modeType;
|
||||
GameManager.UIMgr.ShowPanel<UI_SelectDevicePanel>(E_UI_Layer.Mid, (panel) =>
|
||||
{
|
||||
GameManager.EventMgr.EventTrigger(Enum_EventType.SwitchMode);
|
||||
panel.Init();
|
||||
GameManager.UIMgr.HidePanel<UI_SelectModePanel>();//TODO 框架中设计一个SelfClose()感觉更好
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,10 +74,10 @@ public class UI_SelectWorkTicketPanel : BasePanel
|
|||
GameManager.UIMgr.ShowPanel<UI_LowTensionWorkTicketPanel>(E_UI_Layer.Mid);
|
||||
GameManager.UIMgr.HidePanel<UI_SelectWorkTicketPanel>();
|
||||
}
|
||||
else
|
||||
{
|
||||
GetControl<Text>("Text_True").gameObject.SetActive(true);
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// GetControl<Text>("Text_True").gameObject.SetActive(true);
|
||||
//}
|
||||
break;
|
||||
case E_ModeType.Exam:
|
||||
if (GetControl<Toggle>("ImageF").isOn)
|
||||
|
@ -86,10 +86,10 @@ public class UI_SelectWorkTicketPanel : BasePanel
|
|||
GameManager.UIMgr.ShowPanel<UI_LowTensionWorkTicketPanel>(E_UI_Layer.Mid);
|
||||
GameManager.UIMgr.HidePanel<UI_SelectWorkTicketPanel>();
|
||||
}
|
||||
else
|
||||
{
|
||||
GetControl<Text>("Text_True").gameObject.SetActive(true);
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// GetControl<Text>("Text_True").gameObject.SetActive(true);
|
||||
//}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -4,6 +4,7 @@ using DG.Tweening;
|
|||
using UnityEngine.UI;
|
||||
using UnityEngine.SceneManagement;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
public class UI_TaskListPanel : BasePanel
|
||||
{
|
||||
|
@ -46,21 +47,34 @@ public class UI_TaskListPanel : BasePanel
|
|||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 点击第一个
|
||||
/// 重置学习调用
|
||||
/// </summary>
|
||||
/// <param name="state">0 未完成所有步骤跳转,1 完成所有步骤跳转</param>
|
||||
public void ClickFirstSubProcessesItem(int state)
|
||||
public void ClickFirstSubProcessesItem(int state, Action _cancelCallback = null)
|
||||
{
|
||||
if (_content.GetChild(0).GetComponent<UI_SubProcessItem>())
|
||||
{
|
||||
_content.GetChild(0).GetComponent<UI_SubProcessItem>().OnResetClick(true, state);
|
||||
_content.GetChild(0).GetComponent<UI_SubProcessItem>().OnResetClick(true, state, state == 1 ? _cancelCallback : null);
|
||||
return;
|
||||
}
|
||||
if (_content.GetChild(1).GetComponent<UI_SubProcessItem>())
|
||||
{
|
||||
_content.GetChild(1).GetComponent<UI_SubProcessItem>().OnResetClick(true, state);
|
||||
_content.GetChild(1).GetComponent<UI_SubProcessItem>().OnResetClick(true, state, state == 1 ? _cancelCallback : null);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 重置练习调用
|
||||
/// </summary>
|
||||
public void ResetPractice()
|
||||
{
|
||||
GameManager.UIMgr.ShowPanel<UI_MessagePanel>(E_UI_Layer.System, (p) =>
|
||||
{
|
||||
p.Init("提示", "是否重新学习?", E_MessageType.Error, () =>
|
||||
{
|
||||
GameManager.Instance.Practice();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
protected override void OnClick(string btnName)
|
||||
{
|
||||
|
@ -74,7 +88,7 @@ public class UI_TaskListPanel : BasePanel
|
|||
ClickFirstSubProcessesItem(0);
|
||||
break;
|
||||
case "RePracticeBtn":
|
||||
GameManager.Instance.Practice();
|
||||
ResetPractice();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -15,6 +15,7 @@ public class UI_TipsForPracticePanel : BasePanel
|
|||
}
|
||||
protected override void OnClick(string btnName)
|
||||
{
|
||||
GameManager.UIMgr.HidePanel<UI_TipsForPracticePanel>();
|
||||
switch (btnName)
|
||||
{
|
||||
case "StartPractice":
|
||||
|
@ -23,7 +24,10 @@ public class UI_TipsForPracticePanel : BasePanel
|
|||
case "ResetStudy":
|
||||
if (GameManager.UIMgr.GetPanel<UI_TaskListPanel>())
|
||||
{
|
||||
GameManager.UIMgr.GetPanel<UI_TaskListPanel>().ClickFirstSubProcessesItem(1);
|
||||
GameManager.UIMgr.GetPanel<UI_TaskListPanel>().ClickFirstSubProcessesItem(1, () =>
|
||||
{
|
||||
GameManager.UIMgr.ShowPanel<UI_TipsForPracticePanel>(E_UI_Layer.System);
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "BackBtn":
|
||||
|
@ -32,6 +36,5 @@ public class UI_TipsForPracticePanel : BasePanel
|
|||
default:
|
||||
break;
|
||||
}
|
||||
GameManager.UIMgr.HidePanel<UI_TipsForPracticePanel>();
|
||||
}
|
||||
}
|
|
@ -95,15 +95,15 @@ public class EventCenter : BaseManager<EventCenter>
|
|||
/// <typeparam name="T">参数类型</typeparam>
|
||||
/// <param name="type">事件名称</param>
|
||||
/// <param name="action">有参委托函数</param>
|
||||
public void AddEventListener<T,D>(Enum_EventType type, UnityAction<T,D> action)
|
||||
public void AddEventListener<T, D>(Enum_EventType type, UnityAction<T, D> action)
|
||||
{
|
||||
if (eventEnumDic.ContainsKey(type))
|
||||
{
|
||||
(eventEnumDic[type] as EventInfo<T,D>).actions += action;
|
||||
(eventEnumDic[type] as EventInfo<T, D>).actions += action;
|
||||
}
|
||||
else
|
||||
{
|
||||
eventEnumDic.Add(type, new EventInfo<T,D>(action));
|
||||
eventEnumDic.Add(type, new EventInfo<T, D>(action));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,11 +139,11 @@ public class EventCenter : BaseManager<EventCenter>
|
|||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="action"></param>
|
||||
public void RemoveEventListener<T,D>(Enum_EventType type, UnityAction<T,D> action)
|
||||
public void RemoveEventListener<T, D>(Enum_EventType type, UnityAction<T, D> action)
|
||||
{
|
||||
if (eventEnumDic.ContainsKey(type))
|
||||
{
|
||||
(eventEnumDic[type] as EventInfo<T,D>).actions -= action;
|
||||
(eventEnumDic[type] as EventInfo<T, D>).actions -= action;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -267,7 +267,7 @@ public class EventCenter : BaseManager<EventCenter>
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 清空所有事件监听
|
||||
|
@ -277,4 +277,24 @@ public class EventCenter : BaseManager<EventCenter>
|
|||
eventDic.Clear();
|
||||
eventEnumDic.Clear();
|
||||
}
|
||||
/// <summary>
|
||||
/// 清除报空事件监听
|
||||
/// </summary>
|
||||
public void ClearNull()
|
||||
{
|
||||
foreach (var eventName in eventDic.Keys)
|
||||
{
|
||||
if (string.IsNullOrEmpty(eventName) || eventName == null)
|
||||
{
|
||||
eventDic.Remove(eventName);
|
||||
}
|
||||
}
|
||||
foreach (var eventName in eventEnumDic.Keys)
|
||||
{
|
||||
if (string.IsNullOrEmpty(eventName.ToString()) || eventName.ToString() == null)
|
||||
{
|
||||
eventEnumDic.Remove(eventName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
"index": 1,
|
||||
"subProcessId": 1,
|
||||
"currentScore": 0.0,
|
||||
"isDone": true
|
||||
"isDone": false
|
||||
},
|
||||
{
|
||||
"index": 2,
|
||||
"subProcessId": 2,
|
||||
"currentScore": 0.0,
|
||||
"isDone": true
|
||||
"isDone": false
|
||||
},
|
||||
{
|
||||
"index": 3,
|
||||
|
@ -112,31 +112,10 @@
|
|||
"isDone": false
|
||||
}
|
||||
],
|
||||
"experiencedScene": [
|
||||
"02_MenuScene",
|
||||
"03_OfficeScene"
|
||||
],
|
||||
"allToolAndMaterial": [],
|
||||
"allWear": [],
|
||||
"sceneName": "03_OfficeScene",
|
||||
"sceneName": "02_MenuScene",
|
||||
"currentSceneTools": [],
|
||||
"currentSceneTriggers": [
|
||||
{
|
||||
"triggerID": 5005,
|
||||
"triggerName": "手机",
|
||||
"selfPosInScene": {
|
||||
"x": 0.0244421959,
|
||||
"y": 0.885706842,
|
||||
"z": -1.00569367
|
||||
},
|
||||
"selfRotInScene": {
|
||||
"x": 0.0,
|
||||
"y": 0.0,
|
||||
"z": 0.0
|
||||
},
|
||||
"triggerInfo": "{\"downIndex\":\"2\",\"triggerID\":\"5005\",\"triggerName\":\"\\u624B\\u673A\"}"
|
||||
}
|
||||
],
|
||||
"currentSceneOtherInfo": "{\r\n \"TestPen3list\": [],\r\n \"InSwitchCloseYDList\": [],\r\n \"InSwitchOpenYDList\": [],\r\n \"currentunInstallJieXian\": [],\r\n \"currentInstallJieXian\": [],\r\n \"installCover\": [],\r\n \"currentInstallTestJieXian\": []\r\n}",
|
||||
"experiencedScenes": []
|
||||
"currentSceneTriggers": [],
|
||||
"currentSceneOtherInfo": "{\r\n \"TestPen3list\": [],\r\n \"InSwitchCloseYDList\": [],\r\n \"InSwitchOpenYDList\": [],\r\n \"currentunInstallJieXian\": [],\r\n \"currentInstallJieXian\": [],\r\n \"installCover\": [],\r\n \"currentInstallTestJieXian\": []\r\n}"
|
||||
}
|
Loading…
Reference in New Issue