diff --git a/Forest/Assets/Config/Level/level111.json b/Forest/Assets/Config/Level/level111.json index cec3671..04de0e8 100644 --- a/Forest/Assets/Config/Level/level111.json +++ b/Forest/Assets/Config/Level/level111.json @@ -2,7 +2,7 @@ "columnCount": 5, "rowCount": 7, "undoCount": 0, - "addTimeCount": 2, + "addTimeCount": 1, "openHoleCount": 0, "resetCount": 1, "holesIndex": [ diff --git a/Forest/Assets/Config/Level/level112.json b/Forest/Assets/Config/Level/level112.json index 9cef77c..ad5e07e 100644 --- a/Forest/Assets/Config/Level/level112.json +++ b/Forest/Assets/Config/Level/level112.json @@ -1,7 +1,7 @@ { "columnCount": 4, "rowCount": 7, - "undoCount": 1, + "undoCount": 0, "addTimeCount": 0, "openHoleCount": 1, "resetCount": 1, diff --git a/Forest/Assets/Config/Level/level66.json b/Forest/Assets/Config/Level/level66.json index e67b711..c42ae58 100644 --- a/Forest/Assets/Config/Level/level66.json +++ b/Forest/Assets/Config/Level/level66.json @@ -1,9 +1,9 @@ { "columnCount": 5, "rowCount": 5, - "undoCount": 1, + "undoCount": 0, "addTimeCount": 0, - "openHoleCount": 1, + "openHoleCount": 0, "resetCount": 1, "holesIndex": [ 0, diff --git a/Forest/Assets/Config/Level/level67.json b/Forest/Assets/Config/Level/level67.json index 31c356a..f765cc4 100644 --- a/Forest/Assets/Config/Level/level67.json +++ b/Forest/Assets/Config/Level/level67.json @@ -2,8 +2,8 @@ "columnCount": 5, "rowCount": 5, "undoCount": 0, - "addTimeCount": 1, - "openHoleCount": 2, + "addTimeCount": 0, + "openHoleCount": 1, "resetCount": 1, "holesIndex": [ 0, diff --git a/Forest/Assets/Config/Level/level69.json b/Forest/Assets/Config/Level/level69.json index b93fc5f..2b8f157 100644 --- a/Forest/Assets/Config/Level/level69.json +++ b/Forest/Assets/Config/Level/level69.json @@ -1,7 +1,7 @@ { "columnCount": 4, "rowCount": 6, - "undoCount": 2, + "undoCount": 0, "addTimeCount": 0, "openHoleCount": 0, "resetCount": 1, diff --git a/Forest/Assets/Scripts/Gameplay/Debug/SROptions.Level.cs b/Forest/Assets/Scripts/Gameplay/Debug/SROptions.Level.cs index 9bb92ee..8f746c0 100644 --- a/Forest/Assets/Scripts/Gameplay/Debug/SROptions.Level.cs +++ b/Forest/Assets/Scripts/Gameplay/Debug/SROptions.Level.cs @@ -44,18 +44,26 @@ public partial class SROptions { LevelManager.Instance.IsNewbieGuide = true; } + + [Category("关卡相关"), DisplayName("通关到")] + public int PassLevelIndex + { + get => LevelSelectManager.Instance.CurPassLevelIndex; + set => LevelSelectManager.Instance.PassAllLevel(value); + } + [Category("界面相关"), DisplayName("开启评分弹窗")] public void OpenScore() { UIManager.Instance.OpenWindow(UIConstants.UIScore); } - + [Category("界面相关"), DisplayName("开启用户隐私协议弹窗")] public void OpenUserAgreement() { UIManager.Instance.OpenWindow(UIConstants.UIUserAgreement); } - + [Category("界面相关"), DisplayName("开启同步弹窗")] public void OpenSyncData() { @@ -116,7 +124,7 @@ public partial class SROptions { AppInfoManager.Instance.ClearRemoteDataWithClientID(); } - + #if SDK_FIREBASE [Category("崩溃相关"), DisplayName("发送Firebase崩溃测试")] public void TestCrash() diff --git a/Forest/Assets/Scripts/Gameplay/Game/GameStateStart.cs b/Forest/Assets/Scripts/Gameplay/Game/GameStateStart.cs index 92794b6..bbb3b58 100644 --- a/Forest/Assets/Scripts/Gameplay/Game/GameStateStart.cs +++ b/Forest/Assets/Scripts/Gameplay/Game/GameStateStart.cs @@ -7,16 +7,18 @@ namespace Gameplay.Game public class GameStateStart : IState { private string _windowPos; + private bool _stayTuned; - public GameStateStart(string windowPos) + public GameStateStart(string windowPos, bool stayTuned = false) { _windowPos = windowPos; + _stayTuned = stayTuned; } public void OnEnter() { LoadingExecutorManager.Instance.ExecuteLoading( - new GameStartLoadingExecutor(_windowPos)); + new GameStartLoadingExecutor(_windowPos, _stayTuned)); } public void OnUpdate(float deltaTime) diff --git a/Forest/Assets/Scripts/Gameplay/LoadingExecutor/GameStartLoadingExecutor.cs b/Forest/Assets/Scripts/Gameplay/LoadingExecutor/GameStartLoadingExecutor.cs index c2049a6..c89fe61 100644 --- a/Forest/Assets/Scripts/Gameplay/LoadingExecutor/GameStartLoadingExecutor.cs +++ b/Forest/Assets/Scripts/Gameplay/LoadingExecutor/GameStartLoadingExecutor.cs @@ -16,6 +16,7 @@ namespace Gameplay.LoadingExecutor public class GameStartLoadingExecutor : LoadingExecutorWithUILoadingController { private string _windowPos; + private bool _stayTuned; protected override async UniTask _DoLoading() { @@ -39,9 +40,10 @@ namespace Gameplay.LoadingExecutor _destProgress = 100f; } - public GameStartLoadingExecutor(string windowPos) + public GameStartLoadingExecutor(string windowPos, bool stayTuned = false) { _windowPos = windowPos; + _stayTuned = stayTuned; } private async UniTask InitGfx() @@ -55,7 +57,7 @@ namespace Gameplay.LoadingExecutor { UIRoot.Instance.BgDestroy(); await UIManager.Instance.OpenWindow(_windowPos); - + //用户协议 -> 登录 -> 数据同步 if (AppInfoManager.Instance.UpdateConfirm) await UIManager.Instance.OpenWindow(UIConstants.UISyncTip); @@ -65,6 +67,9 @@ namespace Gameplay.LoadingExecutor if (!PlayerPrefs.HasKey(LevelConstants.FirstLaunch)) await UIManager.Instance.OpenWindow(UIConstants.UIUserAgreement); + + if (_stayTuned) + await UIManager.Instance.OpenWindow(UIConstants.UIStayTuned); } private async UniTask PreLoadSelectLevel() diff --git a/Forest/Assets/Scripts/Gameplay/Manager/LevelSelectManager.cs b/Forest/Assets/Scripts/Gameplay/Manager/LevelSelectManager.cs index ab4aa53..8a211b1 100644 --- a/Forest/Assets/Scripts/Gameplay/Manager/LevelSelectManager.cs +++ b/Forest/Assets/Scripts/Gameplay/Manager/LevelSelectManager.cs @@ -80,9 +80,10 @@ namespace Gameplay.Manager UpdateLevelInfo(); } - public void PassAllLevel() + public void PassAllLevel(int levelId = 0) { - var level = $"level{_allLevels.Count}"; + var id = levelId == 0 ? _allLevels.Count : levelId; + var level = $"level{id}"; SaveNewPassLevel(level); UpdateLevelInfo(); } diff --git a/Forest/Assets/Scripts/Gameplay/UI/EndPanel/UIWinPanelController.cs b/Forest/Assets/Scripts/Gameplay/UI/EndPanel/UIWinPanelController.cs index 538fa3a..2e69b80 100644 --- a/Forest/Assets/Scripts/Gameplay/UI/EndPanel/UIWinPanelController.cs +++ b/Forest/Assets/Scripts/Gameplay/UI/EndPanel/UIWinPanelController.cs @@ -53,7 +53,7 @@ public class UIWinPanelController : UIWindow _txtOldCoins = newNumber; _txtCoins.text = _txtOldCoins.ToString(); } - + protected override void OnOpenWindow(object data) { _rawImageGaussianBlurMask.texture = CommonUIUtils.RenderTexture; @@ -83,27 +83,26 @@ public class UIWinPanelController : UIWindow _txtCoins.text = ShopManager.Instance.CurCoin.ToString(); } - private void OpenShopInLevel() + private async void OpenShopInLevel() { - UIManager.Instance.OpenWindow(UIConstants.UIShop); + await UIManager.Instance.OpenWindow(UIConstants.UIShop); } - private void NextLevel() + private async void NextLevel() { - BIManager.Instance.TrackEventLevel(cfg.BI.Event.level_next_level); CloseWindow(); + BIManager.Instance.TrackEventLevel(cfg.BI.Event.level_next_level); UIManager.Instance.CloseWindow(UIConstants.UIPausePanel); var nextLevelID = LevelManager.Instance.CurrentLevel.GetLevelIndex() + 1; var levelID = $"level{nextLevelID}"; if (LevelManager.Instance.IsLevelExist(levelID)) { GameStateManager.Instance.ChangeState(new LevelState(levelID)); - CloseWindow(); } else { - GameStateManager.Instance.ChangeState(new GameStateStart(UIConstants.UIMainPanel)); - UIManager.Instance.OpenWindow(UIConstants.UIStayTuned); + UIManager.Instance.CloseWindow(UIConstants.UILevelPanel, true); + GameStateManager.Instance.ChangeState(new GameStateStart(UIConstants.UIMainPanel, true)); } } diff --git a/Forest/Assets/Scripts/Gameplay/UI/Level/UILevelSelectController.cs b/Forest/Assets/Scripts/Gameplay/UI/Level/UILevelSelectController.cs index 11867cc..5d0b9d6 100644 --- a/Forest/Assets/Scripts/Gameplay/UI/Level/UILevelSelectController.cs +++ b/Forest/Assets/Scripts/Gameplay/UI/Level/UILevelSelectController.cs @@ -21,8 +21,8 @@ public class UILevelSelectController : UIWindow private ScrollRect _scrollRect; private RectTransform _contentTrans; - private float _listHeight = 1960f; - private const float SingleHeight = 165f; + private float _listHeight; + private float _singleHeight; protected override void OnAwake() { @@ -31,6 +31,7 @@ public class UILevelSelectController : UIWindow _scrollRect = _levelObj.GetComponent(); _contentTrans = FindObj("Scv_LevelList/Viewport/Content").GetComponent(); _listHeight = _contentTrans.rect.height; + _singleHeight = _listHeight / LevelConstants.LevelSelectCount; InitGfx(); InitData(); @@ -75,7 +76,7 @@ public class UILevelSelectController : UIWindow var index = levelIndex % LevelConstants.LevelSelectCount; var listNumber = levelIndex / LevelConstants.LevelSelectCount; - float targetPosition = (index * SingleHeight + listNumber * _listHeight) / _contentTrans.rect.height; + float targetPosition = (index * _singleHeight + listNumber * _listHeight) / _contentTrans.rect.height; _scrollRect.normalizedPosition = new Vector2(_scrollRect.normalizedPosition.x, 1f - targetPosition); } diff --git a/Forest/Assets/Scripts/Gameplay/UI/Level/UILevelSelectItem.cs b/Forest/Assets/Scripts/Gameplay/UI/Level/UILevelSelectItem.cs index d9d01c3..36be8da 100644 --- a/Forest/Assets/Scripts/Gameplay/UI/Level/UILevelSelectItem.cs +++ b/Forest/Assets/Scripts/Gameplay/UI/Level/UILevelSelectItem.cs @@ -1,3 +1,4 @@ +using TMPro; using PhxhSDK; using Framework.BI; using UnityEngine.UI; @@ -7,7 +8,6 @@ using Framework.Manager; using Framework.Constants; using System.Collections.Generic; using System.Text.RegularExpressions; -using TMPro; public class UILevelSelectItem : UIListItem { @@ -17,6 +17,8 @@ public class UILevelSelectItem : UIListItem private Image _imgBottom; private List _levelID; + private bool show; + private const string BtnPath = "Btns/Btn_Level ({0})"; private const string LevelIDPath = "Btns/Btn_Level ({0})/txt_LevelID"; private const string LockPath = "Btns/Btn_Level ({0})/Img_Lock"; @@ -27,12 +29,9 @@ public class UILevelSelectItem : UIListItem protected override void OnBindData(UILevelDataArray data) { + show = false; var passLevelIndex = LevelSelectManager.Instance.CurPassLevelIndex; - var groupIndex = passLevelIndex / LevelConstants.LevelSelectCount; - var levelIndex = passLevelIndex % LevelConstants.LevelSelectCount; - - DebugUtil.LogError("通关是:{0}", passLevelIndex); //根据数据绑定UI for (int i = 0; i < LevelConstants.LevelSelectCount; i++) { @@ -40,29 +39,24 @@ public class UILevelSelectItem : UIListItem _levelIDTexts[i] = _go.GetItem(string.Format(LevelIDPath, i)); _locks[i] = _go.GetItem(string.Format(LockPath, i)); } - - //最后一关 - var gfx = false; - if (passLevelIndex == LevelSelectManager.Instance.CurAllLevelDatas.Count && - groupIndex * LevelConstants.LevelSelectCount == passLevelIndex) - { - gfx = true; - LevelSelectManager.Instance.CurBtnObj = _go.FindObj(string.Format(BtnPath, _btns.Length - 1)); - LevelSelectManager.Instance.GfxSelectLevel.transform.position = - LevelSelectManager.Instance.CurBtnObj.transform.position; - } - + _levelID = new List(); for (int i = 0; i < LevelConstants.LevelSelectCount; i++) { if (data.LevelID[i] != null) { - //特效表现 - if (groupIndex == data.LevelIndex && levelIndex == i && !gfx) + //特效 + if (data.LevelIndex * LevelConstants.LevelSelectCount + i == passLevelIndex && + passLevelIndex != LevelSelectManager.Instance.CurAllLevelDatas.Count) { LevelSelectManager.Instance.CurBtnObj = _go.FindObj(string.Format(BtnPath, i)); - LevelSelectManager.Instance.GfxSelectLevel.transform.position = - LevelSelectManager.Instance.CurBtnObj.transform.position; + show = true; + } + else if (data.LevelIndex * LevelConstants.LevelSelectCount + 1 + i == passLevelIndex && + passLevelIndex == LevelSelectManager.Instance.CurAllLevelDatas.Count) + { + LevelSelectManager.Instance.CurBtnObj = _go.FindObj(string.Format(BtnPath, _btns.Length - 1)); + show = true; } //上锁表现 @@ -87,8 +81,12 @@ public class UILevelSelectItem : UIListItem _levelID.Add(data.LevelID[i]); } - /*else - _btns[i].gameObject.SetActive(false);*/ + } + + if (show) + { + LevelSelectManager.Instance.GfxSelectLevel.transform.position = + LevelSelectManager.Instance.CurBtnObj.transform.position; } } @@ -98,6 +96,9 @@ public class UILevelSelectItem : UIListItem { _btns[i].onClick.RemoveAllListeners(); } + + if (show) + LevelSelectManager.Instance.CurBtnObj = null; } diff --git a/Forest/Assets/Scripts/Gameplay/UI/Other/UIStayTunedController.cs b/Forest/Assets/Scripts/Gameplay/UI/Other/UIStayTunedController.cs index 0e25990..5fd9311 100644 --- a/Forest/Assets/Scripts/Gameplay/UI/Other/UIStayTunedController.cs +++ b/Forest/Assets/Scripts/Gameplay/UI/Other/UIStayTunedController.cs @@ -10,28 +10,26 @@ public class UIStayTunedController : UIWindow protected override void OnAwake() { EventManager.Instance.Register(EventManager.EventName.RefreshLanguage, ChangeLanguage); - + _rawImageGaussianBlurMask = GetComponent("GaussianBlurMask"); BindButton("Btn_Panel", () => { EventManager.Instance.Send(EventManager.EventName.ShowGfx); - CloseWindow(); + CloseWindow(true); }); - _imgName = StringManager.CurLanguage == StringManager.LanguageType.CN - ? "Img_StayTuned_CN" - : "Img_StayTuned_EN"; - FindObj(_imgName).gameObject.SetActive(true); + ChangeLanguage(); } - + protected override void OnOpenWindow(object data) { EventManager.Instance.Send(EventManager.EventName.HideGfx); _rawImageGaussianBlurMask.texture = CommonUIUtils.RenderTexture; } - + private void ChangeLanguage() { - FindObj(_imgName).gameObject.SetActive(false); + if (_imgName != null) + FindObj(_imgName).gameObject.SetActive(false); _imgName = StringManager.CurLanguage == StringManager.LanguageType.CN ? "Img_StayTuned_CN" : "Img_StayTuned_EN";