67 lines
1.4 KiB
C#
67 lines
1.4 KiB
C#
|
|
using cfg.GuideCfg;
|
|||
|
|
using System;
|
|||
|
|
using System.Collections;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using UnityEngine;
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 引导组
|
|||
|
|
/// </summary>
|
|||
|
|
public class GuideGroup
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 引导步骤
|
|||
|
|
/// </summary>
|
|||
|
|
private readonly LinkedList<GuideStepBase> linkGuideStep;
|
|||
|
|
/// <summary>
|
|||
|
|
/// 当前引导步骤
|
|||
|
|
/// </summary>
|
|||
|
|
private readonly LinkedListNode<GuideStepBase> curStep;
|
|||
|
|
|
|||
|
|
public GuideGroup(LinkedList<DataGuideCfg> linkCfg)
|
|||
|
|
{
|
|||
|
|
linkGuideStep = new();
|
|||
|
|
|
|||
|
|
foreach (DataGuideCfg cfg in linkCfg)
|
|||
|
|
{
|
|||
|
|
linkGuideStep.AddLast(CreateGuideStep(cfg));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
curStep = linkGuideStep.First;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 开始引导
|
|||
|
|
/// </summary>
|
|||
|
|
public void BeginGuide()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 结束引导
|
|||
|
|
/// </summary>
|
|||
|
|
public void EndGuide()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 创建引导步骤
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="dataGuideCfg"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
private GuideStepBase CreateGuideStep(DataGuideCfg dataGuideCfg)
|
|||
|
|
{
|
|||
|
|
if (null == dataGuideCfg)
|
|||
|
|
return null;
|
|||
|
|
|
|||
|
|
return dataGuideCfg.GuideType switch // TODO,测试类型
|
|||
|
|
{
|
|||
|
|
"播放视频" => new PlayVideoStep(dataGuideCfg),
|
|||
|
|
"点击视频" => new ClickButtonStep(dataGuideCfg),
|
|||
|
|
_ => throw new Exception("未处理类型"),
|
|||
|
|
};
|
|||
|
|
}
|
|||
|
|
}
|