From ddafb5b5020c003c9194445f8c41c1ae0457f8af Mon Sep 17 00:00:00 2001 From: Cg-Fly <1499046294@qq.com> Date: Tue, 11 Feb 2025 14:21:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=8F=E4=B8=AA=E7=8E=AF=E8=8A=82=E5=89=8D?= =?UTF-8?q?=EF=BC=8C=E5=8A=A0=E4=B8=80=E4=B8=AA=E7=8E=AF=E8=8A=82=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E7=9A=84=E5=91=88=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIPrefabs/OperationStepPanel.prefab | 8 +-- .../UIPrefabs/ShowTitleUIPrefab.prefab | 44 +++++++++++++++++ .../Application/UI/OperationStepPanel.cs | 49 +++++++++++++------ .../Application/UI/ShowTitleUIPrefab.cs | 13 ++++- 4 files changed, 92 insertions(+), 22 deletions(-) diff --git a/Assets/Resources/UIPrefabs/OperationStepPanel.prefab b/Assets/Resources/UIPrefabs/OperationStepPanel.prefab index 0a5f6c4..4cad318 100644 --- a/Assets/Resources/UIPrefabs/OperationStepPanel.prefab +++ b/Assets/Resources/UIPrefabs/OperationStepPanel.prefab @@ -2050,7 +2050,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 5, y: 0} - m_SizeDelta: {x: -10, y: 0} + m_SizeDelta: {x: -10, y: 50} m_Pivot: {x: 0, y: 1} --- !u!222 &5184453082923954450 CanvasRenderer: @@ -4510,7 +4510,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!224 &6909671619946731258 RectTransform: m_ObjectHideFlags: 0 @@ -6115,7 +6115,7 @@ RectTransform: m_Father: {fileID: 1169451575554686425} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 1} @@ -9775,7 +9775,7 @@ RectTransform: m_Father: {fileID: 6217422223439787322} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} diff --git a/Assets/Resources/UIPrefabs/ShowTitleUIPrefab.prefab b/Assets/Resources/UIPrefabs/ShowTitleUIPrefab.prefab index c84fd1b..8bec9b7 100644 --- a/Assets/Resources/UIPrefabs/ShowTitleUIPrefab.prefab +++ b/Assets/Resources/UIPrefabs/ShowTitleUIPrefab.prefab @@ -12,6 +12,8 @@ GameObject: - component: {fileID: 3731273582728425241} - component: {fileID: 6766142397346494237} - component: {fileID: 2815523795474415186} + - component: {fileID: 3857849087552778732} + - component: {fileID: 7429251951377472192} m_Layer: 5 m_Name: ShowTitleUIPrefab m_TagString: Untagged @@ -155,6 +157,48 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d583acfdce1cdc34d8fd388fed42eb8a, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!225 &3857849087552778732 +CanvasGroup: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 961553053187823139} + m_Enabled: 1 + m_Alpha: 0 + m_Interactable: 0 + m_BlocksRaycasts: 1 + m_IgnoreParentGroups: 0 +--- !u!114 &7429251951377472192 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 961553053187823139} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 --- !u!1 &2338194075695899517 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/_Scripts/Application/UI/OperationStepPanel.cs b/Assets/_Scripts/Application/UI/OperationStepPanel.cs index 9c208fb..23b5be4 100644 --- a/Assets/_Scripts/Application/UI/OperationStepPanel.cs +++ b/Assets/_Scripts/Application/UI/OperationStepPanel.cs @@ -277,6 +277,19 @@ namespace ZXK.LouDiXvMuNiu UpdateSelectItem(obj); WordExplain(obj); + if (GameManager.Instance._DataNiuHandler.CurNiuHandler.Value.TaskName == ConstCtrl.TaskName_ActualOperation + &&GameManager.Instance._DataNiuHandler.CurNiuHandler.PreviousValue.ThreeTaskName!= + GameManager.Instance._DataNiuHandler.CurNiuHandler.Value.ThreeTaskName) + { + imgIntroduceGeo.SetActive(false); + _introduceGeo.SetActive(false); + UI_Manage.Instance.HidePanel("ShowToastUIPrefab"); + GameObject showTitleUIGeo = UI_Manage.Instance.ShowPanel("ShowTitleUIPrefab", Type.GetType("ZXK.LouDiXvMuNiu.ShowTitleUIPrefab"), UIGroup.Tip); + showTitleUIGeo.GetComponent().SetTextAudMsg(obj.ThreeTaskName, null, () => + { + WordTip(obj); + }); + } //此处判断是否显示工具箱 if (!GameManager.Instance._IsTrain&& @@ -615,10 +628,25 @@ namespace ZXK.LouDiXvMuNiu } _nextBtn.GetComponent().anchoredPosition = new Vector2(890.0f, 966.0f); } - else if (obj.TaskType.Equals(ConstCtrl.TASKTYPE_Anim)) + + _nextBtn.onClick.RemoveAllListeners(); + _nextBtn.onClick.AddListener(() => + { + if (NiuSceneMng._Instance._IsPlayAnm) return; + _defaultCameraTRTog.isOn = true; + NiuData nextStep= GameManager.Instance._DataNiuHandler.GetNextStep(); + if (nextStep.TaskType == ConstCtrl.TASKTYPE_Tran) + { + nextStep = GameManager.Instance._DataNiuHandler.GetNextStep(nextStep); + } + GameManager.Instance._DataNiuHandler.CurNiuHandler.Value = nextStep; + }); + } + + private void WordTip(NiuData obj) + { + if (obj.TaskType.Equals(ConstCtrl.TASKTYPE_Anim)) { - imgIntroduceGeo.SetActive(false); - _introduceGeo.SetActive(false); if (GameManager.Instance._StateContext.GetState().Name.Equals("TrainState")) { if (string.IsNullOrEmpty(obj.ProcessDescription)) @@ -643,20 +671,9 @@ namespace ZXK.LouDiXvMuNiu } _nextBtn.GetComponent().anchoredPosition = new Vector2(890.0f, 966.0f); } - _nextBtn.onClick.RemoveAllListeners(); - _nextBtn.onClick.AddListener(() => - { - if (NiuSceneMng._Instance._IsPlayAnm) return; - _defaultCameraTRTog.isOn = true; - NiuData nextStep= GameManager.Instance._DataNiuHandler.GetNextStep(); - if (nextStep.TaskType == ConstCtrl.TASKTYPE_Tran) - { - nextStep = GameManager.Instance._DataNiuHandler.GetNextStep(nextStep); - } - GameManager.Instance._DataNiuHandler.CurNiuHandler.Value = nextStep; - }); } - + + /// /// 手动摄像机则按钮变为false /// diff --git a/Assets/_Scripts/Application/UI/ShowTitleUIPrefab.cs b/Assets/_Scripts/Application/UI/ShowTitleUIPrefab.cs index 081f585..09b3aac 100644 --- a/Assets/_Scripts/Application/UI/ShowTitleUIPrefab.cs +++ b/Assets/_Scripts/Application/UI/ShowTitleUIPrefab.cs @@ -1,14 +1,16 @@ +using System; using System.Collections; using System.Collections.Generic; using CG.Framework; using CG.UTility; +using DG.Tweening; using UnityEngine; using UnityEngine.UI; /******************************************************************************* *Create By CG *Function *******************************************************************************/ -namespace ZXK.GYJQR +namespace ZXK.LouDiXvMuNiu { public class ShowTitleUIPrefab : UIBase { @@ -21,8 +23,15 @@ namespace ZXK.GYJQR _audioClipCtrl = gameObject.AddComponent(); } } - public void SetTextAudMsg(string content, string audName) + public void SetTextAudMsg(string content, string audName,Action callback = null) { + Sequence sequence = DOTween.Sequence(); + sequence.Append(transform.GetComponent().DOFade(1.0f, 0.5f)) + .Append(transform.GetComponent().DOFade(0.0f, 0.5f).SetDelay(1.0f).OnComplete(()=> { + if (callback != null) callback(); + Destroy(gameObject); + })); + Text textTemp = transform.Find("TxtBG/Text").GetComponent(); if (UtilitiesMng.GetTransCharNum(content) > 68) {