引导数据处理修改
parent
dd5b4b039f
commit
8e5a69fd71
|
|
@ -19,6 +19,14 @@ public class GuideGroup
|
|||
private LinkedListNode<GuideStepBase> curStep;
|
||||
|
||||
#region 属性
|
||||
/// <summary>
|
||||
/// 引导组id
|
||||
/// </summary>
|
||||
public int GroupId
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否引导中
|
||||
/// </summary>
|
||||
|
|
@ -58,8 +66,9 @@ public class GuideGroup
|
|||
}
|
||||
#endregion
|
||||
|
||||
public GuideGroup(LinkedList<DataGuideCfg> linkCfg)
|
||||
public GuideGroup(int groupId, LinkedList<DataGuideCfg> linkCfg)
|
||||
{
|
||||
GroupId = groupId;
|
||||
linkGuideStep = new();
|
||||
|
||||
foreach (DataGuideCfg cfg in linkCfg)
|
||||
|
|
|
|||
|
|
@ -55,11 +55,14 @@ public class GuideManager : Singlenton<GuideManager>, IInitable
|
|||
if (!IsEnable)
|
||||
return false;
|
||||
|
||||
if (IsGuiding)
|
||||
return false;
|
||||
|
||||
foreach (var guide in dicGuideCfg)
|
||||
{
|
||||
if (guide.Key > completeId)
|
||||
{
|
||||
curGroup = new(dicGuideCfg[1]); // TODO 测试
|
||||
curGroup = new(guide.Key, guide.Value); // TODO 测试
|
||||
curGroup.BeginGuide();
|
||||
return true;
|
||||
}
|
||||
|
|
@ -85,16 +88,20 @@ public class GuideManager : Singlenton<GuideManager>, IInitable
|
|||
|
||||
if (curGroup.IsComplete)
|
||||
{
|
||||
completeId = curGroup.GroupId;
|
||||
|
||||
// TODO 完成引导组,保存服务器
|
||||
int nextGroupId = curGroup.NextGroupId;
|
||||
if (dicGuideCfg.TryGetValue(nextGroupId, out LinkedList<DataGuideCfg> linkCfg))
|
||||
{
|
||||
curGroup = new(linkCfg);
|
||||
curGroup = new(nextGroupId, linkCfg);
|
||||
curGroup.BeginGuide();
|
||||
}
|
||||
else
|
||||
{
|
||||
curGroup = null;
|
||||
UIManager.Instance.CloseWindow(UINameConst.UI_Guide);
|
||||
UIManager.Instance.CloseWindow(UINameConst.UI_GuideTip);
|
||||
// 引导结束
|
||||
}
|
||||
}
|
||||
|
|
@ -115,10 +122,11 @@ public class GuideManager : Singlenton<GuideManager>, IInitable
|
|||
continue;
|
||||
|
||||
DataGuideCfg addCfg = cfg; // 记录要添加进链表的引导步骤配置
|
||||
int groudId = cfg.GroupId;
|
||||
LinkedList<DataGuideCfg> linkCfg = new();
|
||||
dicGuideCfg[cfg.GroupId] = linkCfg;
|
||||
dicGuideCfg[groudId] = linkCfg;
|
||||
|
||||
while (null != addCfg)
|
||||
while (null != addCfg && addCfg.GroupId == groudId)
|
||||
{
|
||||
linkCfg.AddLast(addCfg);
|
||||
addCfg = TableManager.Instance.Tables.GuideConfig.Get(addCfg.NextId);
|
||||
|
|
|
|||
|
|
@ -135,6 +135,13 @@ public class ClickButtonStep : GuideStepBase
|
|||
buttonPath = cfg.GuideTypeParams[1];
|
||||
}
|
||||
|
||||
protected override async void DoBeforeComplete()
|
||||
{
|
||||
base.DoBeforeComplete();
|
||||
|
||||
await UI_GuideController.Open();
|
||||
}
|
||||
|
||||
protected override async void DoGuide()
|
||||
{
|
||||
await UI_GuideController.Open(uiName, buttonPath, Cfg);
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ public class UI_CampController : UIWindow
|
|||
|
||||
protected override void OnShowWindow(object data = null)
|
||||
{
|
||||
base.OnShowWindow(data);
|
||||
|
||||
SceneHandle sceneHandle = GameSceneHelper.Instance.GetCurrentUIViewScene();
|
||||
if (sceneHandle == null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@
|
|||
"Id": 5,
|
||||
"GroupId": 1,
|
||||
"BeginCondition": 0,
|
||||
"NextId": 0,
|
||||
"NextId": 6,
|
||||
"GuideType": "点击按钮",
|
||||
"GuideTypeParams": [
|
||||
"Camp/UI_Camp",
|
||||
|
|
@ -100,99 +100,24 @@
|
|||
"Tip": "点击返回"
|
||||
},
|
||||
{
|
||||
"Id": 100,
|
||||
"GroupId": 100,
|
||||
"BeginCondition": 0,
|
||||
"NextId": 101,
|
||||
"GuideType": "",
|
||||
"GuideTypeParams": [],
|
||||
"CompleteType": "",
|
||||
"CompleteTypeParams": [],
|
||||
"ArrowDirection": "",
|
||||
"ArrowOffset": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"Tip": ""
|
||||
},
|
||||
{
|
||||
"Id": 101,
|
||||
"GroupId": 100,
|
||||
"BeginCondition": 0,
|
||||
"NextId": 102,
|
||||
"GuideType": "",
|
||||
"GuideTypeParams": [],
|
||||
"CompleteType": "",
|
||||
"CompleteTypeParams": [],
|
||||
"ArrowDirection": "",
|
||||
"ArrowOffset": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"Tip": ""
|
||||
},
|
||||
{
|
||||
"Id": 102,
|
||||
"GroupId": 100,
|
||||
"BeginCondition": 0,
|
||||
"NextId": 103,
|
||||
"GuideType": "",
|
||||
"GuideTypeParams": [],
|
||||
"CompleteType": "",
|
||||
"CompleteTypeParams": [],
|
||||
"ArrowDirection": "",
|
||||
"ArrowOffset": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"Tip": ""
|
||||
},
|
||||
{
|
||||
"Id": 103,
|
||||
"GroupId": 100,
|
||||
"BeginCondition": 0,
|
||||
"NextId": 104,
|
||||
"GuideType": "",
|
||||
"GuideTypeParams": [],
|
||||
"CompleteType": "",
|
||||
"CompleteTypeParams": [],
|
||||
"ArrowDirection": "",
|
||||
"ArrowOffset": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"Tip": ""
|
||||
},
|
||||
{
|
||||
"Id": 104,
|
||||
"GroupId": 100,
|
||||
"BeginCondition": 0,
|
||||
"NextId": 105,
|
||||
"GuideType": "",
|
||||
"GuideTypeParams": [],
|
||||
"CompleteType": "",
|
||||
"CompleteTypeParams": [],
|
||||
"ArrowDirection": "",
|
||||
"ArrowOffset": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"Tip": ""
|
||||
},
|
||||
{
|
||||
"Id": 105,
|
||||
"GroupId": 100,
|
||||
"Id": 6,
|
||||
"GroupId": 6,
|
||||
"BeginCondition": 0,
|
||||
"NextId": 0,
|
||||
"GuideType": "",
|
||||
"GuideTypeParams": [],
|
||||
"CompleteType": "",
|
||||
"CompleteTypeParams": [],
|
||||
"ArrowDirection": "",
|
||||
"GuideType": "点击按钮",
|
||||
"GuideTypeParams": [
|
||||
"MainPanel/UI_MainPanel",
|
||||
"Image_ButtonBG/Button_Camp"
|
||||
],
|
||||
"CompleteType": "打开界面",
|
||||
"CompleteTypeParams": [
|
||||
"Camp/UI_Camp"
|
||||
],
|
||||
"ArrowDirection": "下",
|
||||
"ArrowOffset": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
"y": 50
|
||||
},
|
||||
"Tip": ""
|
||||
"Tip": "再点击营地"
|
||||
}
|
||||
]
|
||||
Loading…
Reference in New Issue