Merge branch 'main' into iOS_release

iOS_release
zhangaotian 2024-07-30 12:29:47 +08:00
commit 10e10d01c2
5 changed files with 65 additions and 27 deletions

View File

@ -327,7 +327,7 @@ public class BuildBoot : MonoBehaviour
? CurCondition ? CurCondition
: BuildManager.Instance.ReachCondition; : BuildManager.Instance.ReachCondition;
var nextLockNode = BuildManager.Instance.GetNextLockNode(CurCondition); var nextLockNode = BuildManager.Instance.GetNextLockNode();
if (string.IsNullOrEmpty(nextLockNode)) if (string.IsNullOrEmpty(nextLockNode))
{ {
foreach (var chooseNode in chooseNodeInfo) foreach (var chooseNode in chooseNodeInfo)
@ -429,7 +429,6 @@ public class BuildBoot : MonoBehaviour
/// </summary> /// </summary>
private void InitUI() private void InitUI()
{ {
//选择时UI
var otherRoot = GameObject.Find("OtherRoot").gameObject; var otherRoot = GameObject.Find("OtherRoot").gameObject;
_mask = otherRoot.transform.Find("Mask").gameObject; _mask = otherRoot.transform.Find("Mask").gameObject;
_pickItem = GameObject.Find("OtherRoot/PickItem").gameObject; _pickItem = GameObject.Find("OtherRoot/PickItem").gameObject;
@ -472,6 +471,7 @@ public class BuildBoot : MonoBehaviour
private void CloseTipPanel() private void CloseTipPanel()
{ {
_tipObj.SetActive(false); _tipObj.SetActive(false);
BuildManager.Instance.PlaySound();
} }
/// <summary> /// <summary>
@ -485,6 +485,7 @@ public class BuildBoot : MonoBehaviour
GameStateManager.Instance.ChangeState(new LevelState(levelID)); GameStateManager.Instance.ChangeState(new LevelState(levelID));
EventManager.Instance.Send(EventManager.EventName.EnterGame); EventManager.Instance.Send(EventManager.EventName.EnterGame);
} }
BuildManager.Instance.PlaySound();
} }
/// <summary> /// <summary>
@ -492,6 +493,7 @@ public class BuildBoot : MonoBehaviour
/// </summary> /// </summary>
private void CloseBar() private void CloseBar()
{ {
BuildManager.Instance.PlaySound();
_isChanging = false; _isChanging = false;
_buildBar.Close(); _buildBar.Close();
_mask.SetActive(false); _mask.SetActive(false);
@ -513,6 +515,7 @@ public class BuildBoot : MonoBehaviour
/// </summary> /// </summary>
private void YesBar() private void YesBar()
{ {
BuildManager.Instance.PlaySound();
_isChanging = false; _isChanging = false;
_mask.SetActive(false); _mask.SetActive(false);
_pickItem.SetActive(false); _pickItem.SetActive(false);
@ -566,7 +569,7 @@ public class BuildBoot : MonoBehaviour
var optionObj = obj.transform.parent.gameObject; var optionObj = obj.transform.parent.gameObject;
var nodeName = optionObj.transform.parent.name; var nodeName = optionObj.transform.parent.name;
var optionName = optionObj.name; var optionName = optionObj.name;
BuildManager.Instance.PlaySound();
if (_nodes.TryGetValue(nodeName, out var node)) if (_nodes.TryGetValue(nodeName, out var node))
{ {
_curNode = node; _curNode = node;
@ -585,17 +588,6 @@ public class BuildBoot : MonoBehaviour
} }
} }
/// <summary>
/// 描边展示
/// </summary>
private void OutlinePickItem(Option option)
{
_pickItem.SetActive(true);
_pickItem.transform.position = option.OptionObj.transform.position;
_pickSpriteRenderer.sprite =
option.NormalObj.GetComponent<SpriteRenderer>().sprite;
}
/// <summary> /// <summary>
/// 泡泡点击 /// 泡泡点击
/// </summary> /// </summary>
@ -608,7 +600,7 @@ public class BuildBoot : MonoBehaviour
obj.SetActive(false); obj.SetActive(false);
var nodeName = obj.transform.parent.name; var nodeName = obj.transform.parent.name;
EventManager.Instance.Send(EventManager.EventName.HideMainUI); EventManager.Instance.Send(EventManager.EventName.HideMainUI);
BuildManager.Instance.PlaySound();
if (_nodes.TryGetValue(nodeName, out var node)) if (_nodes.TryGetValue(nodeName, out var node))
{ {
var condition = BuildManager.Instance.GetCondition(nodeName); var condition = BuildManager.Instance.GetCondition(nodeName);
@ -642,7 +634,7 @@ public class BuildBoot : MonoBehaviour
} }
_newOption = option; _newOption = option;
BuildManager.Instance.PlaySound();
OutlinePickItem(option); OutlinePickItem(option);
//DebugUtil.LogError("点击了{0}节点的{1}选项", nodeName, option.OptionObj.name); //DebugUtil.LogError("点击了{0}节点的{1}选项", nodeName, option.OptionObj.name);
@ -655,9 +647,29 @@ public class BuildBoot : MonoBehaviour
{ {
_mask.SetActive(true); _mask.SetActive(true);
_tipObj.SetActive(true); _tipObj.SetActive(true);
BuildManager.Instance.PlaySound();
EventManager.Instance.Send(EventManager.EventName.OpenUI); EventManager.Instance.Send(EventManager.EventName.OpenUI);
} }
/// <summary>
/// 描边展示
/// </summary>
private void OutlinePickItem(Option option)
{
_pickItem.SetActive(true);
_pickItem.transform.position = option.OptionObj.transform.position;
_pickSpriteRenderer.sprite =
option.NormalObj.GetComponent<SpriteRenderer>().sprite;
}
private void UpdateReachCondition()
{
//TODO 不同类型的条件
CurCondition = LevelSelectManager.Instance.CurPassLevelIndex;
BuildManager.Instance.UpdateReachCondition(CurCondition);
}
#endregion #endregion
private void RegisterEvent() private void RegisterEvent()
@ -666,6 +678,7 @@ public class BuildBoot : MonoBehaviour
InputManager.Instance.OnBuildBubbleClick += OnBuildBubbleClick; InputManager.Instance.OnBuildBubbleClick += OnBuildBubbleClick;
EventManager.Instance.Register(EventManager.EventName.HideBuildUI, HideUI); EventManager.Instance.Register(EventManager.EventName.HideBuildUI, HideUI);
EventManager.Instance.Register(EventManager.EventName.ShowBuildUI, ShowUI); EventManager.Instance.Register(EventManager.EventName.ShowBuildUI, ShowUI);
EventManager.Instance.Register(EventManager.EventName.RefreshGameData, UpdateReachCondition);
} }
private void UnregisterClickEvent() private void UnregisterClickEvent()
@ -678,5 +691,6 @@ public class BuildBoot : MonoBehaviour
EventManager.Instance.Unregister(EventManager.EventName.HideBuildUI, HideUI); EventManager.Instance.Unregister(EventManager.EventName.HideBuildUI, HideUI);
EventManager.Instance.Unregister(EventManager.EventName.ShowBuildUI, ShowUI); EventManager.Instance.Unregister(EventManager.EventName.ShowBuildUI, ShowUI);
EventManager.Instance.Unregister(EventManager.EventName.RefreshGameData, UpdateReachCondition);
} }
} }

View File

@ -189,6 +189,7 @@ namespace Framework.Manager
//Build场景相机 //Build场景相机
public Camera CurBuildCamera; public Camera CurBuildCamera;
private BuildData _curBuildData; private BuildData _curBuildData;
private bool _isInit; private bool _isInit;
private bool _isInGame; private bool _isInGame;
@ -205,6 +206,7 @@ namespace Framework.Manager
InitCondition(); InitCondition();
await InitIcon(); await InitIcon();
InitBlueprint(); InitBlueprint();
_isInGame = inGame;
if (inGame) if (inGame)
CurBuildCamera = CameraManager.Instance.UICamera; CurBuildCamera = CameraManager.Instance.UICamera;
_isInit = true; _isInit = true;
@ -451,8 +453,10 @@ namespace Framework.Manager
StorageManager.Instance.SaveWithoutUpdate(); StorageManager.Instance.SaveWithoutUpdate();
} }
/// <summary>
public string GetNextLockNode(int condition) /// 获取下一个解锁节点
/// </summary>
public string GetNextLockNode()
{ {
string nodeName = null; string nodeName = null;
@ -475,9 +479,9 @@ namespace Framework.Manager
} }
var firstNode = NodeInfos var firstNode = NodeInfos
.OrderBy(kv => kv.Value.Condition) .OrderBy(kv => kv.Value.Condition)
.FirstOrDefault(); .FirstOrDefault();
return firstNode.Key; return firstNode.Key;
} }
//TODO 按主题解锁 //TODO 按主题解锁
@ -499,12 +503,25 @@ namespace Framework.Manager
_reachCondition = condition; _reachCondition = condition;
} }
/// <summary>
/// 更新本地节点选择
/// </summary>
public void SetBuildUserInfo(int guideGroupID) public void SetBuildUserInfo(int guideGroupID)
{ {
_userBuildInfo.GuideGroup = guideGroupID; _userBuildInfo.GuideGroup = guideGroupID;
StorageManager.Instance.SyncForce = true; StorageManager.Instance.SyncForce = true;
} }
/// <summary>
/// 播放音效
/// </summary>
public void PlaySound()
{
if (_isInGame)
AudioManager.Instance.PlaySound(AudioType.SOUND, "S_Btn",
new UnityAudio(false));
}
/// <summary> /// <summary>
/// Debug 清楚玩家所有选择 /// Debug 清楚玩家所有选择
/// </summary> /// </summary>

View File

@ -63,11 +63,12 @@ namespace Gameplay.LoadingExecutor
} }
//判断是否开启新手引导 //判断是否开启新手引导
if (!GuideMananger.Instance.IsGuiding && buildInfo.GuideGroup <= 0) if (!GuideMananger.Instance.IsGuiding && buildInfo.GuideGroup <= 0 &&
LevelSelectManager.Instance.CurPassLevelIndex < 1)
{ {
buildInfo.ChooseNodeInfo = new Dictionary<string, string>(); buildInfo.ChooseNodeInfo = new Dictionary<string, string>();
GuideMananger.Instance.NeedGuide = true; GuideMananger.Instance.NeedGuide = true;
DebugUtil.LogG("开启新手引导!"); DebugUtil.LogG("需要开启新手引导!");
} }
var buildId = buildInfo.BuildData; var buildId = buildInfo.BuildData;

View File

@ -5,10 +5,10 @@ using Framework.BI;
using UnityEngine.UI; using UnityEngine.UI;
using Gameplay.Login; using Gameplay.Login;
using Framework.Event; using Framework.Event;
using Gameplay.Manager;
using Framework.Manager; using Framework.Manager;
using Framework.Constants; using Framework.Constants;
using Event = cfg.BI.Event; using Event = cfg.BI.Event;
using System;
public class UILoginPanelController : UIWindow public class UILoginPanelController : UIWindow
{ {
@ -37,7 +37,7 @@ public class UILoginPanelController : UIWindow
#endif #endif
ChangeLanguage(); ChangeLanguage();
} }
protected override void OnOpenWindow(object data) protected override void OnOpenWindow(object data)
{ {
BIManager.Instance.TrackEvent(Event.show_login); BIManager.Instance.TrackEvent(Event.show_login);
@ -121,11 +121,12 @@ public class UILoginPanelController : UIWindow
} }
else if (!_needHideGfx) else if (!_needHideGfx)
{ {
GuideMananger.Instance.StartGroupGuide(); if (LevelSelectManager.Instance.CurPassLevelIndex < 1)
GuideMananger.Instance.StartGroupGuide();
EventManager.Instance.Send(EventManager.EventName.ShowGfx); EventManager.Instance.Send(EventManager.EventName.ShowGfx);
} }
} }
private void OnDestroy() private void OnDestroy()
{ {
EventManager.Instance.Unregister(EventManager.EventName.LoginFail, LoginFail); EventManager.Instance.Unregister(EventManager.EventName.LoginFail, LoginFail);

View File

@ -1,3 +1,4 @@
using Gameplay.Manager;
using Framework.Event; using Framework.Event;
using UnityEngine.UI; using UnityEngine.UI;
using Framework.BI; using Framework.BI;
@ -31,7 +32,11 @@ public class UISyncTipController : UIWindow
private void CloseUI() private void CloseUI()
{ {
CloseWindow(true); CloseWindow(true);
GuideMananger.Instance.StartGroupGuide(); if (LevelSelectManager.Instance.CurPassLevelIndex < 1)
{
DebugUtil.LogG("开启新手引导!");
GuideMananger.Instance.StartGroupGuide();
}
if (!_needHideGfx) if (!_needHideGfx)
EventManager.Instance.Send(EventManager.EventName.ShowGfx); EventManager.Instance.Send(EventManager.EventName.ShowGfx);
} }