【新手引导】完善

iOS_release
zhangaotian 2024-07-25 15:29:18 +08:00
parent e94cb66e96
commit 7af8c4def4
19 changed files with 4751 additions and 4350 deletions

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
"GuideType": 0, "GuideType": 0,
"GuideParams": "BuildRoot/Node5/Option1/Normal", "GuideParams": "BuildRoot/Node5/Option1/Normal",
"GuideCompleteType": 0, "GuideCompleteType": 0,
"GuideCompleteParams": "" "GuideCompleteParams": "BuildBoot/BuildUIRoot/UIMainBuild/UI_LiuHaiBottom/Build_Bar"
}, },
{ {
"ID": 102, "ID": 102,
@ -17,20 +17,20 @@
"GuideNote": "更换建造物", "GuideNote": "更换建造物",
"GuideDesKey": "Guide_102", "GuideDesKey": "Guide_102",
"GuideType": 0, "GuideType": 0,
"GuideParams": "BuildBoot/BuildUIRoot/UIMainBuild/UI_LiuHaiBottom/Build_Bar/Bar_Tip/Scroll View/Viewport/Content/Item2/Img_Item\n", "GuideParams": "BuildBoot/BuildUIRoot/UIMainBuild/UI_LiuHaiBottom/Build_Bar/Bar_Tip/Scroll View/Viewport/Content/Item2/Img_Item",
"GuideCompleteType": 0, "GuideCompleteType": 3,
"GuideCompleteParams": "" "GuideCompleteParams": "BuildRoot/Node5/Option2/Normal"
}, },
{ {
"ID": 103, "ID": 103,
"NextID": 104, "NextID": 104,
"GroupID": 1, "GroupID": 1,
"GuideNote": "点击保存", "GuideNote": "保存更改",
"GuideDesKey": "Guide_103", "GuideDesKey": "Guide_103",
"GuideType": 0, "GuideType": 0,
"GuideParams": "BuildBoot/BuildUIRoot/UIMainBuild/UI_LiuHaiBottom/Build_Bar/Btn_Yes", "GuideParams": "BuildBoot/BuildUIRoot/UIMainBuild/UI_LiuHaiBottom/Build_Bar/Btn_Yes",
"GuideCompleteType": 1, "GuideCompleteType": 1,
"GuideCompleteParams": "" "GuideCompleteParams": "BuildBoot/BuildUIRoot/UIMainBuild/UI_LiuHaiBottom/Build_Bar"
}, },
{ {
"ID": 104, "ID": 104,
@ -41,7 +41,7 @@
"GuideType": 0, "GuideType": 0,
"GuideParams": "BuildRoot/Node1/Btn", "GuideParams": "BuildRoot/Node1/Btn",
"GuideCompleteType": 0, "GuideCompleteType": 0,
"GuideCompleteParams": "" "GuideCompleteParams": "BuildBoot/BuildUIRoot/UIMainBuild/UI_LiuHaiBottom/Build_Bar"
}, },
{ {
"ID": 105, "ID": 105,
@ -52,7 +52,7 @@
"GuideType": 0, "GuideType": 0,
"GuideParams": "BuildBoot/BuildUIRoot/UIMainBuild/UI_LiuHaiBottom/Build_Bar/Bar_Tip/Scroll View/Viewport/Content/Item1/Img_Lock", "GuideParams": "BuildBoot/BuildUIRoot/UIMainBuild/UI_LiuHaiBottom/Build_Bar/Bar_Tip/Scroll View/Viewport/Content/Item1/Img_Lock",
"GuideCompleteType": 0, "GuideCompleteType": 0,
"GuideCompleteParams": "" "GuideCompleteParams": "BuildBoot/BuildUIRoot/UIMainBuild/Build_Tip"
}, },
{ {
"ID": 106, "ID": 106,

View File

@ -63,4 +63,10 @@ QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm
退 退
屿

View File

@ -1,12 +1,13 @@
using System; using System;
using PhxhSDK; using PhxhSDK;
using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
namespace Framework.Event namespace Framework.Event
{ {
public partial class EventManager :Singlenton<EventManager> public partial class EventManager : Singlenton<EventManager>
{ {
private Dictionary<EventName, HashSet<Delegate>> _eventDict = new Dictionary<EventName, HashSet<Delegate>>(); private Dictionary<EventName, HashSet<Delegate>> _eventDict = new Dictionary<EventName, HashSet<Delegate>>();
private Action<EventName> _afterSendCallBack; private Action<EventName> _afterSendCallBack;
@ -124,7 +125,6 @@ namespace Framework.Event
return; return;
} }
var actions = _eventDict[eventName]; var actions = _eventDict[eventName];
var tempExecuteList = GetTempExecuteList(); var tempExecuteList = GetTempExecuteList();
tempExecuteList.AddRange(actions); tempExecuteList.AddRange(actions);
@ -158,7 +158,8 @@ namespace Framework.Event
return; return;
} }
var actions = _eventDict[eventName]; var actions = _eventDict[eventName].ToList();
foreach (var action in actions) foreach (var action in actions)
{ {
if (action is Action actionT) if (action is Action actionT)
@ -166,6 +167,7 @@ namespace Framework.Event
actionT(); actionT();
} }
} }
_afterSendCallBack?.Invoke(eventName); _afterSendCallBack?.Invoke(eventName);
} }
catch (Exception e) catch (Exception e)
@ -186,4 +188,4 @@ namespace Framework.Event
return false; return false;
} }
} }
} }

View File

@ -36,6 +36,7 @@ namespace Framework.Event
GuideMaskStart, //更换遮罩对象 GuideMaskStart, //更换遮罩对象
OpenUI, OpenUI,
CloseUI, CloseUI,
ChangeBuild,
EnterGame, EnterGame,
} }

View File

@ -129,7 +129,6 @@ public class BuildBoot : MonoBehaviour
public void Open(Node node, Action<Option> callBack, Action lockCallBack, int reachCondition, int condition) public void Open(Node node, Action<Option> callBack, Action lockCallBack, int reachCondition, int condition)
{ {
EventManager.Instance.Send(EventManager.EventName.OpenUI);
_optionCallBack = callBack; _optionCallBack = callBack;
_bar.SetActive(true); _bar.SetActive(true);
_condition.text = string.Format(ConditionText, reachCondition, condition); _condition.text = string.Format(ConditionText, reachCondition, condition);
@ -469,7 +468,9 @@ public class BuildBoot : MonoBehaviour
var levelID = $"level{LevelSelectManager.Instance.CurPassLevelIndex + 1}"; var levelID = $"level{LevelSelectManager.Instance.CurPassLevelIndex + 1}";
if (LevelManager.Instance.IsLevelExist(levelID)) if (LevelManager.Instance.IsLevelExist(levelID))
{ {
DebugUtil.LogError("进入游戏一次");
GameStateManager.Instance.ChangeState(new LevelState(levelID)); GameStateManager.Instance.ChangeState(new LevelState(levelID));
EventManager.Instance.Send(EventManager.EventName.EnterGame);
} }
} }
@ -503,6 +504,7 @@ public class BuildBoot : MonoBehaviour
_mask.SetActive(false); _mask.SetActive(false);
_pickItem.SetActive(false); _pickItem.SetActive(false);
_buildBar.Close(); _buildBar.Close();
EventManager.Instance.Send(EventManager.EventName.CloseUI);
if (_curNode == null || _newOption == null) if (_curNode == null || _newOption == null)
{ {
@ -556,7 +558,9 @@ public class BuildBoot : MonoBehaviour
var condition = BuildManager.Instance.GetCondition(nodeName); var condition = BuildManager.Instance.GetCondition(nodeName);
_buildBar.Open(node, BuildIconClick, BuildLockIconClick, CurCondition, condition); _buildBar.Open(node, BuildIconClick, BuildLockIconClick, CurCondition, condition);
_buildBar.PickItemDisplay(optionName); _buildBar.PickItemDisplay(optionName);
ChangePickItem(_curOption); OutlinePickItem(_curOption);
EventManager.Instance.Send(EventManager.EventName.OpenUI);
} }
else else
{ {
@ -567,7 +571,7 @@ public class BuildBoot : MonoBehaviour
/// <summary> /// <summary>
/// 描边展示 /// 描边展示
/// </summary> /// </summary>
private void ChangePickItem(Option option) private void OutlinePickItem(Option option)
{ {
if (option == null) return; if (option == null) return;
_pickItem.transform.position = option.OptionObj.transform.position; _pickItem.transform.position = option.OptionObj.transform.position;
@ -591,6 +595,8 @@ public class BuildBoot : MonoBehaviour
{ {
var condition = BuildManager.Instance.GetCondition(nodeName); var condition = BuildManager.Instance.GetCondition(nodeName);
_buildBar.Open(node, BuildIconClick, BuildLockIconClick, CurCondition, condition); _buildBar.Open(node, BuildIconClick, BuildLockIconClick, CurCondition, condition);
EventManager.Instance.Send(EventManager.EventName.OpenUI);
} }
else else
{ {
@ -603,6 +609,9 @@ public class BuildBoot : MonoBehaviour
/// </summary> /// </summary>
private void BuildIconClick(Option option) private void BuildIconClick(Option option)
{ {
EventManager.Instance.Send(EventManager.EventName.ChangeBuild);
if (option == _newOption)
return;
var nodeName = option.NodeObj.name; var nodeName = option.NodeObj.name;
//切换UI表现 //切换UI表现
if (_nodes.TryGetValue(nodeName, out var node)) if (_nodes.TryGetValue(nodeName, out var node))
@ -614,7 +623,8 @@ public class BuildBoot : MonoBehaviour
} }
_newOption = option; _newOption = option;
ChangePickItem(option);
OutlinePickItem(option);
//DebugUtil.LogError("点击了{0}节点的{1}选项", nodeName, option.OptionObj.name); //DebugUtil.LogError("点击了{0}节点的{1}选项", nodeName, option.OptionObj.name);
} }
@ -626,6 +636,7 @@ public class BuildBoot : MonoBehaviour
{ {
_mask.SetActive(true); _mask.SetActive(true);
_tipObj.SetActive(true); _tipObj.SetActive(true);
EventManager.Instance.Send(EventManager.EventName.OpenUI);
} }
#endregion #endregion

View File

@ -1,28 +1,30 @@
using System; using System;
using System.Collections.Generic;
using cfg.Guide; using cfg.Guide;
using Framework.UI; using Framework.UI;
using System.Collections.Generic;
public class GuideGroup public class GuideGroup
{ {
public int GroupID; private readonly int _groupID;
public LinkedList<GuideStepBase> GuideSteps = new LinkedList<GuideStepBase>(); private readonly LinkedList<GuideStepBase> _guideSteps = new LinkedList<GuideStepBase>();
public LinkedListNode<GuideStepBase> CurGuideStep; public LinkedListNode<GuideStepBase> CurGuideStep;
public readonly int NextGroupGuideID;
public int NextGroupGuideID;
public GuideGroup(int groupID, LinkedList<DataGuide> groupData) public GuideGroup(int groupID, LinkedList<DataGuide> groupData)
{ {
GroupID = groupID; _groupID = groupID;
NextGroupGuideID = groupData.Last.Value.NextID; NextGroupGuideID = groupData.Last.Value.NextID;
foreach (var data in groupData) foreach (var data in groupData)
{ {
var guideStepBase = InitGuideStep(data); var guideStepBase = InitGuideStep(data);
GuideSteps.AddLast(guideStepBase); _guideSteps.AddLast(guideStepBase);
} }
} }
/// <summary>
/// 初始化具体引导
/// </summary>
private GuideStepBase InitGuideStep(DataGuide guideData) private GuideStepBase InitGuideStep(DataGuide guideData)
{ {
if (guideData == null) return null; if (guideData == null) return null;
@ -34,6 +36,38 @@ public class GuideGroup
}; };
} }
/// <summary>
/// 该组引导是否完成
/// </summary>
public bool IsCompleteGroupGuide()
{
return CurGuideStep != null && CurGuideStep == _guideSteps.Last;
}
/// <summary>
/// 开始组引导
/// </summary>
public void StartGuide()
{
CurGuideStep ??= _guideSteps.First;
CurGuideStep?.Value.StartGuide();
DebugUtil.LogG($"{_groupID}组进入{CurGuideStep?.Value.GuideCfg.ID}号引导");
}
/// <summary>
/// 移动至下一个引导
/// </summary>
public void MoveToNextGuide()
{
CurGuideStep.Value.EndGuide();
CurGuideStep = CurGuideStep.Next;
CurGuideStep?.Value.StartGuide();
DebugUtil.LogG($"{_groupID}组开启下一个引导 {CurGuideStep?.Value.GuideCfg.ID}");
}
public string GetGuideMaskTarget() public string GetGuideMaskTarget()
{ {
return CurGuideStep.Value.GuideCfg.GuideParams; return CurGuideStep.Value.GuideCfg.GuideParams;
@ -44,32 +78,4 @@ public class GuideGroup
var key = CurGuideStep.Value.GuideCfg.GuideDesKey; var key = CurGuideStep.Value.GuideCfg.GuideDesKey;
return StringManager.Instance.GetTextByKey(key); return StringManager.Instance.GetTextByKey(key);
} }
public bool IsCompleteGroupGuide()
{
return CurGuideStep != null && CurGuideStep == GuideSteps.Last;
}
public void StartGuide()
{
CurGuideStep ??= GuideSteps.First;
DebugUtil.LogError("{0}组进入{1}号引导", GroupID, CurGuideStep.Value.GuideCfg.ID);
CurGuideStep?.Value.StartGuide();
}
public void EndGuide()
{
CurGuideStep.Value.EndGuide();
}
/// <summary>
/// 开启下一个引导
/// </summary>
public void MoveToNextGuide()
{
EndGuide();
DebugUtil.LogError("开启下一个引导");
CurGuideStep = CurGuideStep.Next;
StartGuide();
}
} }

View File

@ -23,7 +23,7 @@ public class EventPermeate : MonoBehaviour, IPointerClickHandler, IPointerDownHa
// 监听点击 // 监听点击
public void OnPointerClick(PointerEventData eventData) public void OnPointerClick(PointerEventData eventData)
{ {
PassEvent(eventData, ExecuteEvents.submitHandler); // PassEvent(eventData, ExecuteEvents.submitHandler);
PassEvent(eventData, ExecuteEvents.pointerClickHandler); PassEvent(eventData, ExecuteEvents.pointerClickHandler);
} }

View File

@ -4,6 +4,9 @@ using Framework.Event;
public abstract class GuideCompleteBase public abstract class GuideCompleteBase
{ {
/// <summary>
/// 通用回调
/// </summary>
private readonly Action _completeAction; private readonly Action _completeAction;
public readonly DataGuide GuideCfg; public readonly DataGuide GuideCfg;
@ -13,15 +16,17 @@ public abstract class GuideCompleteBase
_completeAction = completeCallback; _completeAction = completeCallback;
} }
/// <summary>
/// 添加监听
/// </summary>
public abstract void AddListener(); public abstract void AddListener();
/// <summary> /// <summary>
/// 移除监听 /// 移除监听
/// </summary> /// </summary>
public abstract void RemoveListener(); public abstract void RemoveListener();
protected virtual void Complete()
public virtual void Complete()
{ {
DebugUtil.LogError("完成引导回调"); DebugUtil.LogError("完成引导回调");
_completeAction?.Invoke(); _completeAction?.Invoke();
@ -30,18 +35,26 @@ public abstract class GuideCompleteBase
internal sealed class OpenUI : GuideCompleteBase internal sealed class OpenUI : GuideCompleteBase
{ {
private string _uiPath;
public OpenUI(DataGuide dataGuide, Action completeCallback) : base(dataGuide, completeCallback) public OpenUI(DataGuide dataGuide, Action completeCallback) : base(dataGuide, completeCallback)
{ {
_uiPath = dataGuide.GuideCompleteParams;
} }
public override void AddListener() public override void AddListener()
{ {
EventManager.Instance.Register(EventManager.EventName.OpenUI, Complete); EventManager.Instance.Register(EventManager.EventName.OpenUI, OpenUIComplete);
} }
public override void RemoveListener() public override void RemoveListener()
{ {
EventManager.Instance.Unregister(EventManager.EventName.OpenUI, Complete); EventManager.Instance.Unregister(EventManager.EventName.OpenUI, OpenUIComplete);
}
private void OpenUIComplete()
{
Complete();
} }
} }
@ -62,6 +75,23 @@ internal sealed class CloseUI : GuideCompleteBase
} }
} }
internal sealed class ChangeBuild : GuideCompleteBase
{
public ChangeBuild(DataGuide dataGuide, Action completeCallback) : base(dataGuide, completeCallback)
{
}
public override void AddListener()
{
EventManager.Instance.Register(EventManager.EventName.ChangeBuild, Complete);
}
public override void RemoveListener()
{
EventManager.Instance.Unregister(EventManager.EventName.ChangeBuild, Complete);
}
}
internal sealed class EnterGame : GuideCompleteBase internal sealed class EnterGame : GuideCompleteBase
{ {
public EnterGame(DataGuide dataGuide, Action completeCallback) : base(dataGuide, completeCallback) public EnterGame(DataGuide dataGuide, Action completeCallback) : base(dataGuide, completeCallback)

View File

@ -1,13 +1,12 @@
using System;
using Framework.Event;
using TMPro; using TMPro;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using Framework.Event;
[RequireComponent(typeof(EventPermeate))] [RequireComponent(typeof(EventPermeate))]
public class GuideController : MonoBehaviour public class GuideController : MonoBehaviour
{ {
[HideInInspector] public GameObject target; public GameObject target;
private static readonly int CenterShader = Shader.PropertyToID("_Center"); private static readonly int CenterShader = Shader.PropertyToID("_Center");
private static readonly int SliderShader = Shader.PropertyToID("_Slider"); private static readonly int SliderShader = Shader.PropertyToID("_Slider");
@ -64,10 +63,13 @@ public class GuideController : MonoBehaviour
private void ChangeTarget() private void ChangeTarget()
{ {
var targetPath = GuideMananger.Instance.GetGuideMaskTarget(); var targetPath = GuideMananger.Instance.GetGuideMaskTarget();
DebugUtil.LogError("更换目标:{0}", targetPath); target = GameObject.Find(targetPath);
target = GameObject.Find(GuideMananger.Instance.GetGuideMaskTarget());
if (string.IsNullOrEmpty(targetPath) || target == null) if (string.IsNullOrEmpty(targetPath) || target == null)
{
DebugUtil.LogError("target为空:{0}", target == null);
return; return;
}
// 设置事件透传对象 // 设置事件透传对象
gameObject.GetComponent<EventPermeate>().target = target.gameObject; gameObject.GetComponent<EventPermeate>().target = target.gameObject;

View File

@ -1,10 +1,11 @@
using System.Collections.Generic;
using cfg.Guide;
using Cysharp.Threading.Tasks;
using Framework;
using Framework.UI;
using PhxhSDK; using PhxhSDK;
using cfg.Guide;
using Framework;
using UnityEngine; using UnityEngine;
using Framework.UI;
using Framework.Manager;
using Cysharp.Threading.Tasks;
using System.Collections.Generic;
using Constants = Framework.Constants.Constants; using Constants = Framework.Constants.Constants;
public class GuideMananger : Singlenton<GuideMananger>, IInitable public class GuideMananger : Singlenton<GuideMananger>, IInitable
@ -29,11 +30,14 @@ public class GuideMananger : Singlenton<GuideMananger>, IInitable
/// </summary> /// </summary>
private Dictionary<int, LinkedList<DataGuide>> _guideData; private Dictionary<int, LinkedList<DataGuide>> _guideData;
public bool NeedGuide;
/// <summary> /// <summary>
/// 获取引导配置 /// 获取引导配置
/// </summary> /// </summary>
public async UniTask InitData() public async UniTask InitData()
{ {
if (!NeedGuide) return;
var table = TableManager.Instance.Tables.GuideConfig; var table = TableManager.Instance.Tables.GuideConfig;
foreach (var guideData in table.DataList) foreach (var guideData in table.DataList)
{ {
@ -58,7 +62,7 @@ public class GuideMananger : Singlenton<GuideMananger>, IInitable
} }
} }
//TODO读盘得到当前组 _curGuideGroup = BuildManager.Instance.UserBuildInfo.GuideGroup;
if (_curGuideGroup <= 0) if (_curGuideGroup <= 0)
{ {
_curGuideGroup = table.DataList[0].GroupID; _curGuideGroup = table.DataList[0].GroupID;
@ -102,7 +106,6 @@ public class GuideMananger : Singlenton<GuideMananger>, IInitable
/// <summary> /// <summary>
/// 获取描述文字 /// 获取描述文字
/// </summary> /// </summary>
/// <returns></returns>
public string GetGuideDesc() public string GetGuideDesc()
{ {
foreach (var group in _guideGroups) foreach (var group in _guideGroups)
@ -118,6 +121,7 @@ public class GuideMananger : Singlenton<GuideMananger>, IInitable
/// </summary> /// </summary>
public void StartGroupGuide() public void StartGroupGuide()
{ {
if (!NeedGuide) return;
if (_guideGroups.TryGetValue(_curGuideGroup, out var guideGroup)) if (_guideGroups.TryGetValue(_curGuideGroup, out var guideGroup))
{ {
guideGroup.StartGuide(); guideGroup.StartGuide();
@ -135,19 +139,19 @@ public class GuideMananger : Singlenton<GuideMananger>, IInitable
return; return;
if (guideGroup.IsCompleteGroupGuide()) if (guideGroup.IsCompleteGroupGuide())
{ {
_curGuideGroup = guideGroup.NextGroupGuideID; var nextGroup = guideGroup.NextGroupGuideID;
if (!_guideGroups.TryGetValue(_curGuideGroup, out var group)) if (_guideGroups.TryGetValue(nextGroup, out var group))
{
DebugUtil.LogError("完成了所有的引导");
}
else
{ {
group.StartGuide(); group.StartGuide();
DebugUtil.LogG($"开启下一组引导:{nextGroup}");
} }
DebugUtil.LogError($"完成了所有的引导,并保存了{_curGuideGroup}");
BuildManager.Instance.SetBuildUserInfo(_curGuideGroup);
_curGuideGroup = nextGroup;
} }
else else
{ {
guideGroup.MoveToNextGuide(); guideGroup.MoveToNextGuide();
} }
} }

View File

@ -1,15 +1,15 @@
using System; using System;
using cfg.Guide; using cfg.Guide;
using Cysharp.Threading.Tasks;
using Framework.Event;
using UnityEngine; using UnityEngine;
using Framework.Event;
using Cysharp.Threading.Tasks;
public abstract class GuideStepBase public abstract class GuideStepBase
{ {
/// <summary> /// <summary>
/// 引导完成类型 /// 引导完成类型
/// </summary> /// </summary>
private GuideCompleteBase _completeBase; private readonly GuideCompleteBase _completeBase;
public readonly DataGuide GuideCfg; public readonly DataGuide GuideCfg;
@ -21,6 +21,9 @@ public abstract class GuideStepBase
_completeBase = InitGuideStep(guideCfg); _completeBase = InitGuideStep(guideCfg);
} }
/// <summary>
/// 初始化完成类型
/// </summary>
private GuideCompleteBase InitGuideStep(DataGuide guideData) private GuideCompleteBase InitGuideStep(DataGuide guideData)
{ {
if (guideData == null) return null; if (guideData == null) return null;
@ -30,6 +33,7 @@ public abstract class GuideStepBase
StepCompleteType.OpenUI => new OpenUI(guideData, CompleteGuide), StepCompleteType.OpenUI => new OpenUI(guideData, CompleteGuide),
StepCompleteType.CloseUI => new CloseUI(guideData, CompleteGuide), StepCompleteType.CloseUI => new CloseUI(guideData, CompleteGuide),
StepCompleteType.EnterGame => new EnterGame(guideData, CompleteGuide), StepCompleteType.EnterGame => new EnterGame(guideData, CompleteGuide),
StepCompleteType.ChangeBuild => new ChangeBuild(guideData, CompleteGuide),
_ => throw new ArgumentOutOfRangeException($"没有实现{guideData.GuideCompleteType}类型的完成方法") _ => throw new ArgumentOutOfRangeException($"没有实现{guideData.GuideCompleteType}类型的完成方法")
}; };
} }
@ -39,7 +43,7 @@ public abstract class GuideStepBase
/// </summary> /// </summary>
public async void StartGuide() public async void StartGuide()
{ {
//await UniTask.Delay(1000); // 延迟时间开始 await UniTask.Delay(500); // 延迟时间开始
DoBeforeGuide(); DoBeforeGuide();
SubStartGuide(); SubStartGuide();
} }
@ -49,12 +53,12 @@ public abstract class GuideStepBase
/// </summary> /// </summary>
private void DoBeforeGuide() private void DoBeforeGuide()
{ {
//开启该引导相关事件
_completeBase.AddListener();
//打开引导界面 //打开引导界面
GuideMananger.Instance.SetActiveGuideUI(true); GuideMananger.Instance.SetActiveGuideUI(true);
//发送遮罩镂空更改事件 //发送遮罩镂空更改事件
EventManager.Instance.Send(EventManager.EventName.GuideMaskStart); EventManager.Instance.Send(EventManager.EventName.GuideMaskStart);
//开启该引导相关事件
_completeBase.AddListener();
} }
/// <summary> /// <summary>
@ -62,7 +66,7 @@ public abstract class GuideStepBase
/// </summary> /// </summary>
public void EndGuide() public void EndGuide()
{ {
DebugUtil.LogError("结束了{0}引导", GuideCfg.ID); DebugUtil.LogG($"{GuideCfg.ID} 引导结束");
} }
/// <summary> /// <summary>
@ -70,10 +74,10 @@ public abstract class GuideStepBase
/// </summary> /// </summary>
private void CompleteGuide() private void CompleteGuide()
{ {
//移除事件监听
_completeBase.RemoveListener(); _completeBase.RemoveListener();
//关闭引导界面 //关闭引导界面
GuideMananger.Instance.SetActiveGuideUI(false); GuideMananger.Instance.SetActiveGuideUI(false);
DebugUtil.LogError("完成{0}引导", GuideCfg.ID);
//结束引导 //结束引导
GuideMananger.Instance.EndGuide(this); GuideMananger.Instance.EndGuide(this);
} }

View File

@ -111,8 +111,7 @@ namespace Framework.Manager
/// </summary> /// </summary>
public class UserBuildInfo public class UserBuildInfo
{ {
public int GuideGroup;
public int GuideStep;
public string BuildData = GlobalConstants.DefaultBuildID; public string BuildData = GlobalConstants.DefaultBuildID;
public Dictionary<string, string> ChooseNodeInfo; public Dictionary<string, string> ChooseNodeInfo;
@ -470,7 +469,7 @@ namespace Framework.Manager
break; break;
} }
DebugUtil.LogError("得到最小的节点是{0}", nodeName); //DebugUtil.LogError("得到最小的节点是{0}", nodeName);
return nodeName; return nodeName;
} }
@ -484,6 +483,12 @@ namespace Framework.Manager
_reachCondition = condition; _reachCondition = condition;
} }
public void SetBuildUserInfo(int guideGroupID)
{
_userBuildInfo.GuideGroup = guideGroupID;
StorageManager.Instance.SyncForce = true;
}
public void Release() public void Release()
{ {
} }

View File

@ -23,6 +23,10 @@ namespace cfg.Guide
/// 进入游戏 /// 进入游戏
/// </summary> /// </summary>
EnterGame = 2, EnterGame = 2,
/// <summary>
/// 更换建造物
/// </summary>
ChangeBuild = 3,
} }
} }

View File

@ -11,6 +11,7 @@ using Gameplay.Manager;
using Framework.Manager; using Framework.Manager;
using Framework.Constants; using Framework.Constants;
using Cysharp.Threading.Tasks; using Cysharp.Threading.Tasks;
using System.Collections.Generic;
using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets;
namespace Gameplay.LoadingExecutor namespace Gameplay.LoadingExecutor
@ -61,6 +62,14 @@ namespace Gameplay.LoadingExecutor
buildInfo.BuildData = GlobalConstants.DefaultBuildID; buildInfo.BuildData = GlobalConstants.DefaultBuildID;
} }
//判断是否开启新手引导
if (buildInfo.GuideGroup <= 0)
{
buildInfo.ChooseNodeInfo = new Dictionary<string, string>();
GuideMananger.Instance.NeedGuide = true;
DebugUtil.LogG("开启新手引导!");
}
var buildId = buildInfo.BuildData; var buildId = buildInfo.BuildData;
var buildPath = string.Format(Framework.Constants.Constants.SceneBuildPath, buildId); var buildPath = string.Format(Framework.Constants.Constants.SceneBuildPath, buildId);
var buildConfig = string.Format(Framework.Constants.Constants.BuildConfigPath, buildId); var buildConfig = string.Format(Framework.Constants.Constants.BuildConfigPath, buildId);

View File

@ -31,6 +31,7 @@ public class UISyncTipController : UIWindow
private void CloseUI() private void CloseUI()
{ {
CloseWindow(true); CloseWindow(true);
GuideMananger.Instance.StartGroupGuide();
if (!_needHideGfx) if (!_needHideGfx)
EventManager.Instance.Send(EventManager.EventName.ShowGfx); EventManager.Instance.Send(EventManager.EventName.ShowGfx);
} }

View File

@ -1,26 +1,26 @@
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Config/Data/ad_adconfig.json,A36B3A44ABABA2DDE095849E3626C9,1094,1721811695613 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Config/Data/ad_adconfig.json,A36B3A44ABABA2DDE095849E3626C9,1094,1721886650787
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Config/Data/guide_guideconfig.json,63B89485A4872F16EBBFA12E46DB6E1,1776,1721811695613 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Config/Data/guide_guideconfig.json,29B264A23BA8CD2749AD2EC3B7B39D47,2024,1721886650787
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Config/Data/prop_propconfig.json,7C02F583533F144939CBFF8C7E18473,880,1721811695613 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Config/Data/prop_propconfig.json,7C02F583533F144939CBFF8C7E18473,880,1721886650787
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Config/Data/stringcfg_stringconfig.json,7478C1A5F9A0908094F9D896FF2FF8,8311,1721811695613 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Config/Data/stringcfg_stringconfig.json,7478C1A5F9A0908094F9D896FF2FF8,8311,1721886650787
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/AD/ADConfig.cs,A4C9CBC6BD55B1C14634FD73C748ACA,1928,1721811695613 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/AD/ADConfig.cs,A4C9CBC6BD55B1C14634FD73C748ACA,1928,1721886650786
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/AD/ADType.cs,F6A7395BDA6D1E7D1EF51E344CB045,603,1721811695610 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/AD/ADType.cs,F6A7395BDA6D1E7D1EF51E344CB045,603,1721886650786
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/AD/DataAD.cs,7F68864C5AB693111C5C3250967FB782,3417,1721811695610 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/AD/DataAD.cs,7F68864C5AB693111C5C3250967FB782,3417,1721886650786
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/BI/Event.cs,9BC756F4D9E749FBCEF49BF6929557,6506,1721811695613 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/BI/Event.cs,9BC756F4D9E749FBCEF49BF6929557,6506,1721886650787
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/BI/EventFirst.cs,72E992B782D0734B64364E4777CA3B35,2964,1721811695610 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/BI/EventFirst.cs,72E992B782D0734B64364E4777CA3B35,2964,1721886650786
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Guide/DataGuide.cs,A23BB4F3F93B395441BB83D74E59B6F,4292,1721811695613 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Guide/DataGuide.cs,A23BB4F3F93B395441BB83D74E59B6F,4292,1721886650787
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Guide/GuideConfig.cs,B1779443C4E6B0FD80A8B0CAE418015,2003,1721811695613 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Guide/GuideConfig.cs,B1779443C4E6B0FD80A8B0CAE418015,2003,1721886650786
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Guide/GuideStepType.cs,50DE437238924E2724E493BD449A536,520,1721811695610 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Guide/GuideStepType.cs,50DE437238924E2724E493BD449A536,520,1721886650786
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Guide/StepCompleteType.cs,1631A33319C6A46DD2CC7A75A14E7A1,714,1721811695610 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Guide/StepCompleteType.cs,2A047A7CCF76D2AE6F4AA9F89224B13,812,1721886650786
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Prop/DataProp.cs,B1E5165AD7B7B28F863BF25E9581BF7B,4385,1721811695613 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Prop/DataProp.cs,B1E5165AD7B7B28F863BF25E9581BF7B,4385,1721886650787
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Prop/PropConfig.cs,263DA0E1E0FA37A6401A432E49E8,2040,1721811695610 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Prop/PropConfig.cs,263DA0E1E0FA37A6401A432E49E8,2040,1721886650786
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Prop/PropType.cs,56DDB93BC3D6491F012DAE849526897,757,1721811695610 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Prop/PropType.cs,56DDB93BC3D6491F012DAE849526897,757,1721886650786
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/StringCfg/DataString.cs,1613DCE5B077AE52BB90193DD949348,2327,1721811695610 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/StringCfg/DataString.cs,1613DCE5B077AE52BB90193DD949348,2327,1721886650786
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/StringCfg/StringConfig.cs,90AC6ED26EAF4A66498B4816B635F47,2080,1721811695610 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/StringCfg/StringConfig.cs,90AC6ED26EAF4A66498B4816B635F47,2080,1721886650786
/Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Tables.cs,16F3D2F3A20B0D35793F8A5A8194E59,2303,1721811695610 /Users/zhangaotian/UnityProject/Forest_Client/Forest/Assets/Scripts/Gameplay/DataTable/Tables.cs,16F3D2F3A20B0D35793F8A5A8194E59,2303,1721886650786
/Users/zhangaotian/UnityProject/Forest_Client/Tool/Luban/Datas/__beans__.xlsx,FBF2DDFEE7FB39A727F2C3ACA7E228E,11821,1718685908733 /Users/zhangaotian/UnityProject/Forest_Client/Tool/Luban/Datas/__beans__.xlsx,FBF2DDFEE7FB39A727F2C3ACA7E228E,11821,1718685908733
/Users/zhangaotian/UnityProject/Forest_Client/Tool/Luban/Datas/__enums__.xlsx,FDBFA610442B2325BC92A411FFE96FE8,12591,1721811568624 /Users/zhangaotian/UnityProject/Forest_Client/Tool/Luban/Datas/__enums__.xlsx,07D177582EBF7BC5445490E245C996,12604,1721886644427
/Users/zhangaotian/UnityProject/Forest_Client/Tool/Luban/Datas/__tables__.xlsx,CA2D48B6B6FAC5A9F046ACE375EA6A5B,11099,1721709912370 /Users/zhangaotian/UnityProject/Forest_Client/Tool/Luban/Datas/__tables__.xlsx,CA2D48B6B6FAC5A9F046ACE375EA6A5B,11099,1721709912370
/Users/zhangaotian/UnityProject/Forest_Client/Tool/Luban/Datas/AD.xlsx,D49DD4C2226B1AED21398727B2144A9,9832,1721801067448 /Users/zhangaotian/UnityProject/Forest_Client/Tool/Luban/Datas/AD.xlsx,D49DD4C2226B1AED21398727B2144A9,9832,1721801067448
/Users/zhangaotian/UnityProject/Forest_Client/Tool/Luban/Datas/Guide.xlsx,F590D6AF5C7D5B745FF23DB369795E51,10239,1721811687903 /Users/zhangaotian/UnityProject/Forest_Client/Tool/Luban/Datas/Guide.xlsx,C77CE4FBC272D9B8A7F394159464482,10287,1721886642046
/Users/zhangaotian/UnityProject/Forest_Client/Tool/Luban/Datas/Prop.xlsx,518794514E27F37BF9D0B6BA712533A5,10050,1718685908733 /Users/zhangaotian/UnityProject/Forest_Client/Tool/Luban/Datas/Prop.xlsx,518794514E27F37BF9D0B6BA712533A5,10050,1718685908733
/Users/zhangaotian/UnityProject/Forest_Client/Tool/Luban/Datas/StringConfig.xlsx,DF7478D165C035173F51B0BFD0CEA660,13423,1721709916112 /Users/zhangaotian/UnityProject/Forest_Client/Tool/Luban/Datas/StringConfig.xlsx,DF7478D165C035173F51B0BFD0CEA660,13423,1721709916112

Binary file not shown.

Binary file not shown.