From d076b3917ac63c0423822faff160cf0850519238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CCongG=E2=80=9D?= Date: Wed, 15 Jan 2025 19:06:25 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=9C=A8=E7=89=A9=E5=93=81=E6=A0=8F?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E7=89=A9=E5=93=81=E6=97=B6=EF=BC=8C=E8=8B=A5?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BA=86=E9=94=99=E8=AF=AF=E7=9A=84=E7=89=A9?= =?UTF-8?q?=E5=93=81=EF=BC=8C=E5=88=99=E5=BC=B9=E5=87=BA=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=EF=BC=88=E5=BC=B9=E7=AA=97=E5=8F=8A=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E5=AD=97=E8=A7=81UI=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2、所有正确物品都被点击后,则弹出完成提示弹窗“物品准备已完成”(弹窗样式见UI) --- .../Resources/UIPrefabs/ChoseErrorTip.prefab | 2 +- .../Resources/UIPrefabs/ChoseRightTip.prefab | 2 +- .../Application/SceneCtrls/NiuSceneMng.cs | 7 +++--- .../Application/UI/OperationStepPanel.cs | 20 ++++++++++------ .../Application/UI/SelectToolsPanel.cs | 18 ++++++++++++-- .../_Scripts/Framework/Utilities/PopUpMng.cs | 24 +++++++++++++++---- 6 files changed, 54 insertions(+), 19 deletions(-) diff --git a/Assets/Resources/UIPrefabs/ChoseErrorTip.prefab b/Assets/Resources/UIPrefabs/ChoseErrorTip.prefab index 959fdb5..d98ef76 100644 --- a/Assets/Resources/UIPrefabs/ChoseErrorTip.prefab +++ b/Assets/Resources/UIPrefabs/ChoseErrorTip.prefab @@ -183,7 +183,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0, g: 0, b: 0, a: 0.5019608} + m_Color: {r: 0, g: 0, b: 0, a: 0} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 diff --git a/Assets/Resources/UIPrefabs/ChoseRightTip.prefab b/Assets/Resources/UIPrefabs/ChoseRightTip.prefab index 7ca11d3..f06f1c6 100644 --- a/Assets/Resources/UIPrefabs/ChoseRightTip.prefab +++ b/Assets/Resources/UIPrefabs/ChoseRightTip.prefab @@ -183,7 +183,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 0, g: 0, b: 0, a: 0.5019608} + m_Color: {r: 0, g: 0, b: 0, a: 0} m_RaycastTarget: 1 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 diff --git a/Assets/_Scripts/Application/SceneCtrls/NiuSceneMng.cs b/Assets/_Scripts/Application/SceneCtrls/NiuSceneMng.cs index 54f33ad..73235d6 100644 --- a/Assets/_Scripts/Application/SceneCtrls/NiuSceneMng.cs +++ b/Assets/_Scripts/Application/SceneCtrls/NiuSceneMng.cs @@ -704,9 +704,10 @@ namespace ZXK.LouDiXvMuNiu } else { - PopUpMng.PopChoseErrowToast(_CurSceneStep.ExamEvvr, 2.0f); - useBts.Clear(); - addScoreTemp = false; + PopUpMng.PopChoseErrorToast(_CurSceneStep.ExamEvvr, 2.0f,()=> { + useBts.Clear(); + addScoreTemp = false; + }); } } diff --git a/Assets/_Scripts/Application/UI/OperationStepPanel.cs b/Assets/_Scripts/Application/UI/OperationStepPanel.cs index f42d973..857b15c 100644 --- a/Assets/_Scripts/Application/UI/OperationStepPanel.cs +++ b/Assets/_Scripts/Application/UI/OperationStepPanel.cs @@ -234,17 +234,23 @@ namespace ZXK.LouDiXvMuNiu if (obj.ThreeTaskName != GameManager.Instance._DataNiuHandler.CurNiuHandler.PreviousValue.ThreeTaskName) {//ǰֲͬ - List tempData = GameManager.Instance._DataNiuHandler.NiuStepTypeDic[GameManager.Instance._CurModelType]; - int prepareGeoID = 0; - for (int i = 0; i < tempData.Count; i++) + if (GameManager.Instance._StateContext.GetState().Name.Equals("TrainState")) { - if (tempData[i].ThreeTaskName == ConstCtrl.ThreeTaskName_PrepareGeo) + List tempData = GameManager.Instance._DataNiuHandler.NiuStepTypeDic[GameManager.Instance._CurModelType]; + int prepareGeoID = 0; + for (int i = 0; i < tempData.Count; i++) { - prepareGeoID = tempData[i].id; + if (tempData[i].ThreeTaskName == ConstCtrl.ThreeTaskName_PrepareGeo) + { + prepareGeoID = tempData[i].id; + } } + _nextBtn.gameObject.SetActive(obj.id <= prepareGeoID); + } + else + { + _nextBtn.gameObject.SetActive(false); } - _nextBtn.gameObject.SetActive(obj.id <= prepareGeoID); - NiuSceneMng._Instance.InitPlayAnmState(obj, GameManager.Instance._DataNiuHandler.CurNiuHandler.PreviousValue); } UodateCameraTRID(obj); diff --git a/Assets/_Scripts/Application/UI/SelectToolsPanel.cs b/Assets/_Scripts/Application/UI/SelectToolsPanel.cs index efd345b..e1dcd5b 100644 --- a/Assets/_Scripts/Application/UI/SelectToolsPanel.cs +++ b/Assets/_Scripts/Application/UI/SelectToolsPanel.cs @@ -16,6 +16,8 @@ namespace ZXK.LouDiXvMuNiu private GameObject _toolItemPrefab = null; private List _toolBtnArray = new List(); + private int _allTools = 0; + private int _curToolNumber = 0; protected override void Awake() { @@ -42,6 +44,7 @@ namespace ZXK.LouDiXvMuNiu string itemErroTools= tempData[i].OptionErro; if (string.IsNullOrEmpty(itemTools)) continue; string[] rightTools = itemTools.Split("|"); + _allTools = rightTools.Length; string[] erroTools = itemErroTools.Split("|"); string[] allTools = new string[rightTools.Length + erroTools.Length]; rightTools.CopyTo(allTools, 0); @@ -77,11 +80,22 @@ namespace ZXK.LouDiXvMuNiu toolItemGeo.transform.Find("BeUseImg/ChoseRight").gameObject.SetActive(true); GameManager.Instance._EventManager.Raise(new ClickToolArgs() { SelectTool = toolItemGeo.name }); GameManager.Instance._DataNiuHandler.AddScore(curStep.ModuleName, curStep.ThreeTaskName, 1); + _curToolNumber++; + if (_curToolNumber == _allTools) + { + PopUpMng.PopChoseRightToast("е׼", 2.0f,()=> { + NiuData nextStep = GameManager.Instance._DataNiuHandler.GetNextStep(); + GameManager.Instance._DataNiuHandler.CurNiuHandler.Value = nextStep; + }); + } } else { - toolItemGeo.transform.Find("BeUseImg").gameObject.SetActive(true); - toolItemGeo.transform.Find("BeUseImg/ChoseError").gameObject.SetActive(true); + + PopUpMng.PopChoseErrorToast(curStep.ExamEvvr, 2.0f, () => { + toolItemGeo.transform.Find("BeUseImg").gameObject.SetActive(true); + toolItemGeo.transform.Find("BeUseImg/ChoseError").gameObject.SetActive(true); + }); } }); toolItemGeo.SetActive(true); diff --git a/Assets/_Scripts/Framework/Utilities/PopUpMng.cs b/Assets/_Scripts/Framework/Utilities/PopUpMng.cs index eab3b08..5ac414e 100644 --- a/Assets/_Scripts/Framework/Utilities/PopUpMng.cs +++ b/Assets/_Scripts/Framework/Utilities/PopUpMng.cs @@ -120,7 +120,7 @@ namespace CG.UTility /// /// 弹出选择错误提示 /// - public static void PopChoseErrowToast(string content, float stayTime, UIGroup group = UIGroup.Tip) + public static void PopChoseErrorToast(string content, float stayTime, System.Action closeEvent, UIGroup group = UIGroup.Tip) { _TriAble = false; GameObject toastGeo = UI_Manage.Instance.ShowPanel("ChoseErrorTip", System.Type.GetType("CG.Framework.UIBase"), group); @@ -129,21 +129,35 @@ namespace CG.UTility toastGeo.transform.SetAsLastSibling(); if (stayTime > 0) { - _TriAble = true; - GameObject.Destroy(toastGeo, stayTime); + float a = 0; + DOTween.To(() => a, x => a = x, stayTime, stayTime).OnComplete(() => + { + _TriAble = true; + closeEvent?.Invoke(); + GameObject.Destroy(toastGeo); + }); } } /// /// 弹出准备完成提示 /// - public static void PopChoseRightToast(string content, float stayTime, UIGroup group = UIGroup.Tip) + public static void PopChoseRightToast(string content, float stayTime, System.Action closeEvent, UIGroup group = UIGroup.Tip) { + _TriAble = false; GameObject toastGeo = UI_Manage.Instance.ShowPanel("ChoseRightTip", System.Type.GetType("CG.Framework.UIBase"), group); toastGeo.name = "ChoseRightTip"; toastGeo.transform.Find("Mask/ChoseRight/DescText").GetComponent().text = content; toastGeo.transform.SetAsLastSibling(); if (stayTime > 0) - GameObject.Destroy(toastGeo, stayTime); + { + float a = 0; + DOTween.To(() => a, x => a = x, stayTime, stayTime).OnComplete(() => + { + _TriAble = true; + closeEvent?.Invoke(); + GameObject.Destroy(toastGeo); + }); + } } ///