From 4f32ba540d1cda1eba701e5669618b17ddd560fd Mon Sep 17 00:00:00 2001 From: zhangaotian <8474238@qq.com> Date: Thu, 27 Jun 2024 16:58:27 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90UI=E3=80=91=E6=96=B0=E6=89=8B=E5=BC=95?= =?UTF-8?q?=E5=AF=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Art/UI/Prefab/UILevelPanel.prefab | 10 ++--- .../Framework/Constants/Constants.Level.cs | 8 ---- .../Scripts/Gameplay/Level/KongManager.cs | 4 ++ .../UI/Level/UILevelPanelController.cs | 41 ++++++++++++++++--- 4 files changed, 45 insertions(+), 18 deletions(-) diff --git a/Forest/Assets/Art/UI/Prefab/UILevelPanel.prefab b/Forest/Assets/Art/UI/Prefab/UILevelPanel.prefab index 07c7408..b7946e7 100644 --- a/Forest/Assets/Art/UI/Prefab/UILevelPanel.prefab +++ b/Forest/Assets/Art/UI/Prefab/UILevelPanel.prefab @@ -193,7 +193,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 200, y: 330} + m_AnchoredPosition: {x: 311, y: 425} m_SizeDelta: {x: 210, y: 147} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &1732713801463255801 @@ -1780,7 +1780,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 160, y: -385} + m_AnchoredPosition: {x: 343, y: -507} m_SizeDelta: {x: 210, y: 147} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &4337338171065191632 @@ -1910,8 +1910,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: -29} - m_SizeDelta: {x: 60, y: 500} + m_AnchoredPosition: {x: 110, y: -24} + m_SizeDelta: {x: 54, y: 450} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &7559599749038722353 CanvasRenderer: @@ -2258,7 +2258,7 @@ MonoBehaviour: m_Calls: [] m_text: 'UserID:' m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 7944e7f1ee22bb14fa3a310fd16e8092, type: 2} + m_fontAsset: {fileID: 0} m_sharedMaterial: {fileID: -5302180806271213227, guid: 7944e7f1ee22bb14fa3a310fd16e8092, type: 2} m_fontSharedMaterials: [] diff --git a/Forest/Assets/Scripts/Framework/Constants/Constants.Level.cs b/Forest/Assets/Scripts/Framework/Constants/Constants.Level.cs index 002d06c..f4f5b6d 100644 --- a/Forest/Assets/Scripts/Framework/Constants/Constants.Level.cs +++ b/Forest/Assets/Scripts/Framework/Constants/Constants.Level.cs @@ -31,19 +31,11 @@ namespace Framework.Constants public const int PopUpLimitNumber = 8; public const int LevelRateIndex = 4; - //获胜飞金币 - public static Vector3 CoinGfxPos = new Vector3(-1.5f, -4f, 0f); //生成金币固定位置 - public const float SpawnInterval = 0.1f; // 生成金币的间隔时间 - public const int MaxGfxCoinsNumber = 15; //生成金币最大数量 - /// /// 关卡选择 一页数量 /// public const int LevelSelectCount = 15; - //数字变化速度 - public const float CoinChangeSpeed = 1f; - //通关奖励 public const int RewardCoin = 20; diff --git a/Forest/Assets/Scripts/Gameplay/Level/KongManager.cs b/Forest/Assets/Scripts/Gameplay/Level/KongManager.cs index 6ceaaf7..ab9aeb8 100644 --- a/Forest/Assets/Scripts/Gameplay/Level/KongManager.cs +++ b/Forest/Assets/Scripts/Gameplay/Level/KongManager.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using Cysharp.Threading.Tasks; using Framework.Constants; using Gameplay.Manager; +using System.Linq; using UnityEngine; using PhxhSDK; using System; @@ -15,6 +16,8 @@ namespace Gameplay.Level private Dictionary _holeDic; public Dictionary HoleDic => _holeDic; + public List HoleList; + private List _addedNewHolesPos; private List _addedNewHoles; @@ -67,6 +70,7 @@ namespace Gameplay.Level _addedNewHolesPos = LevelUtils.GetAdditionalAddedHolesPos(new Vector3(xPos[0], yPos[^1], 0f), LevelManager.Instance.CurrentLevel.LevelData.columnCount); + HoleList = _holeDic.Values.ToList(); } catch (Exception e) { diff --git a/Forest/Assets/Scripts/Gameplay/UI/Level/UILevelPanelController.cs b/Forest/Assets/Scripts/Gameplay/UI/Level/UILevelPanelController.cs index 4174b1b..b79cb93 100644 --- a/Forest/Assets/Scripts/Gameplay/UI/Level/UILevelPanelController.cs +++ b/Forest/Assets/Scripts/Gameplay/UI/Level/UILevelPanelController.cs @@ -3,6 +3,7 @@ using System; using UnityEngine; using Framework.BI; using Framework.UI; +using Gameplay.Level; using UnityEngine.UI; using Framework.Event; using Gameplay.Manager; @@ -26,6 +27,14 @@ public class UILevelPanelController : UIWindow private float _txtOldTime; private bool _gfxAddTimeShow; + //新手引导 + private GameObject _newGuideObj1; + private GameObject _newGuideObj2; + + private GameObject _imgArrow; + private GameObject _imgFinger; + private GameObject _imgFinger2; + protected override void OnAwake() { RegisterEvent(); @@ -57,9 +66,31 @@ public class UILevelPanelController : UIWindow _timeAnimator = FindObj("UI_LiuHaiTop/Txt_Time").GetComponent(); //新手引导 - _newbieGuide = FindObj("NewbieGuide").gameObject; if (LevelManager.Instance.IsNewbieGuide) - FindObj("UI_LiuHaiTop/Txt_Time").gameObject.SetActive(false); + { + InitNewGuide(); + } + } + + private void InitNewGuide() + { + _newbieGuide = FindObj("NewbieGuide").gameObject; + FindObj("UI_LiuHaiTop/Txt_Time").gameObject.SetActive(false); + _newGuideObj1 = KongManager.Instance.HoleList[0].Obj; + _newGuideObj2 = KongManager.Instance.HoleList[^1].Obj; + _imgFinger = FindObj("NewbieGuide/img_Finger"); + _imgFinger2 = FindObj("NewbieGuide/img_Finger2"); + _imgArrow = FindObj("NewbieGuide/img_Arrow"); + + if (_newGuideObj2 != null && _newGuideObj1 != null) + { + _imgFinger.transform.position = new Vector3(_newGuideObj2.transform.position.x + 1f, + _newGuideObj1.transform.position.y, _newGuideObj1.transform.position.z); + _imgFinger2.transform.position = new Vector3(_newGuideObj2.transform.position.x + 1f, + _newGuideObj2.transform.position.y, _newGuideObj1.transform.position.z); + _imgArrow.transform.position = new Vector3(_newGuideObj2.transform.position.x, + _imgArrow.transform.position.y, _newGuideObj1.transform.position.z); + } } private void Start() @@ -185,9 +216,9 @@ public class UILevelPanelController : UIWindow private void NewbieGuideNext() { - FindObj("NewbieGuide/img_Arrow").gameObject.SetActive(true); - FindObj("NewbieGuide/img_Finger2").gameObject.SetActive(true); - FindObj("NewbieGuide/img_Finger").gameObject.SetActive(false); + _imgArrow.gameObject.SetActive(true); + _imgFinger2.gameObject.SetActive(true); + _imgFinger.gameObject.SetActive(false); } private void NewbieGuideFinish()