2024-05-22 19:08:14 +08:00
|
|
|
|
using cfg.GuideCfg;
|
2024-05-24 15:07:50 +08:00
|
|
|
|
using System;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
using System.Linq;
|
2024-05-27 13:32:18 +08:00
|
|
|
|
using Cysharp.Threading.Tasks;
|
2024-05-29 16:36:30 +08:00
|
|
|
|
using Gameplay.Level;
|
2024-06-04 18:27:32 +08:00
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
using UnityEngine;
|
2024-07-05 20:49:03 +08:00
|
|
|
|
using Framework;
|
2024-10-15 18:17:40 +08:00
|
|
|
|
using cfg.LevelCfg;
|
2024-10-28 14:22:54 +08:00
|
|
|
|
using Gameplay.Area;
|
2024-10-28 14:45:29 +08:00
|
|
|
|
using Gameplay.Skill;
|
2024-05-22 19:08:14 +08:00
|
|
|
|
|
2024-05-29 16:36:30 +08:00
|
|
|
|
namespace Gameplay.Guide
|
2024-05-24 15:07:50 +08:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 引导状态
|
|
|
|
|
|
/// </summary>
|
2024-05-29 16:36:30 +08:00
|
|
|
|
public enum E_GuideState
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 等待引导
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Idle,
|
2024-10-12 12:53:47 +08:00
|
|
|
|
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 引导中
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Guiding,
|
2024-10-12 12:53:47 +08:00
|
|
|
|
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 引导完成
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
Complete,
|
|
|
|
|
|
}
|
2024-05-24 15:07:50 +08:00
|
|
|
|
|
2024-05-29 13:04:51 +08:00
|
|
|
|
/// <summary>
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// 引导步骤基类
|
2024-05-29 13:04:51 +08:00
|
|
|
|
/// </summary>
|
2024-05-29 16:36:30 +08:00
|
|
|
|
public abstract class GuideStepBase
|
2024-05-29 13:04:51 +08:00
|
|
|
|
{
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 引导完成类型
|
|
|
|
|
|
/// </summary>
|
2024-05-30 19:55:53 +08:00
|
|
|
|
private readonly GuideCompleteBase completeBase;
|
2024-10-29 19:00:00 +08:00
|
|
|
|
private bool isWait;
|
|
|
|
|
|
private bool isComplete;
|
2024-05-29 16:36:30 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 引导配置
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public DataGuideCfg Cfg { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 引导状态
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public E_GuideState GuideState { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否引导中
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool IsGuiding
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return E_GuideState.Guiding == GuideState; }
|
|
|
|
|
|
}
|
2024-05-29 13:04:51 +08:00
|
|
|
|
|
2024-05-29 16:36:30 +08:00
|
|
|
|
public GuideStepBase(DataGuideCfg cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
Cfg = cfg;
|
|
|
|
|
|
|
|
|
|
|
|
GuideState = E_GuideState.Idle;
|
2024-10-29 19:00:00 +08:00
|
|
|
|
isWait = true;
|
|
|
|
|
|
isComplete = false;
|
2024-05-29 16:36:30 +08:00
|
|
|
|
|
|
|
|
|
|
completeBase = Cfg.GuideCompleteType switch
|
|
|
|
|
|
{
|
|
|
|
|
|
E_GuideCompleteType.PlayVideoOver => new PlayVideoComplete(Cfg, Complete),
|
|
|
|
|
|
E_GuideCompleteType.OpenUI => new OpenUIComplete(Cfg, Complete),
|
|
|
|
|
|
E_GuideCompleteType.CloseUI => new CloseUIComplete(Cfg, Complete),
|
2024-10-30 14:49:17 +08:00
|
|
|
|
E_GuideCompleteType.DestroyUI => new DestroyUIComplete(Cfg, Complete),
|
2024-05-29 16:36:30 +08:00
|
|
|
|
E_GuideCompleteType.OpenUIAndAnim => new OpenUIAndAnimComplete(Cfg, Complete),
|
2024-10-16 19:02:03 +08:00
|
|
|
|
E_GuideCompleteType.CloseUIAndAnim => new CloseUIAndAnimComplete(Cfg, Complete),
|
2024-06-04 13:26:59 +08:00
|
|
|
|
E_GuideCompleteType.EnterFightLevelComplete => new EnterFightLevelComplete(Cfg, Complete),
|
2024-06-04 15:13:16 +08:00
|
|
|
|
E_GuideCompleteType.EnterStorylineLevelComplete => new EnterStorylineLevelComplete(Cfg, Complete),
|
2024-05-29 16:36:30 +08:00
|
|
|
|
E_GuideCompleteType.EmbattleComplete => new LevelEmbattleComplete(Cfg, Complete),
|
2024-06-03 16:48:18 +08:00
|
|
|
|
E_GuideCompleteType.EmbattleVehicleComplete => new LevelEmbattleComplete(Cfg, Complete),
|
2024-05-30 15:01:43 +08:00
|
|
|
|
E_GuideCompleteType.FightBegin => new FightBeginComplete(Cfg, Complete),
|
2024-07-02 13:45:19 +08:00
|
|
|
|
E_GuideCompleteType.FightMoveBeginComplete => new FightBeginMoveComplete(Cfg, Complete),
|
2024-05-30 16:49:27 +08:00
|
|
|
|
E_GuideCompleteType.FightMoveComplete => new FightMoveComplete(Cfg, Complete),
|
2024-05-30 19:00:56 +08:00
|
|
|
|
E_GuideCompleteType.FightAttackComplete => new FightAttackComplete(Cfg, Complete),
|
2024-07-02 16:44:14 +08:00
|
|
|
|
E_GuideCompleteType.PreparaUseSkillComplete => new FightPreparaUseSkillComplete(Cfg, Complete),
|
2024-10-15 19:40:57 +08:00
|
|
|
|
E_GuideCompleteType.PreparaUsePlayerSkillComplete => new FightPreparaUsePlayerSkillComplete(Cfg, Complete),
|
2024-05-30 19:00:56 +08:00
|
|
|
|
E_GuideCompleteType.FightUseSkillComplete => new FightUseSkillComplete(Cfg, Complete),
|
2024-07-05 16:14:23 +08:00
|
|
|
|
E_GuideCompleteType.FightUsePlayerSkillComplete => new FightUsePlayerSkillComplete(Cfg, Complete),
|
2024-05-30 19:55:53 +08:00
|
|
|
|
E_GuideCompleteType.LevelComplete => new LevelComplete(Cfg, Complete),
|
2024-06-03 15:57:43 +08:00
|
|
|
|
E_GuideCompleteType.ClickGuideButton => new ClickGuideButtonComplete(Cfg, Complete),
|
2024-07-02 19:45:05 +08:00
|
|
|
|
E_GuideCompleteType.ClickFloorComplete => new ClickGuideFloorComplete(Cfg, Complete),
|
|
|
|
|
|
E_GuideCompleteType.FightStartButtonShowComplete => new WaitFightStartButtonShowComplete(Cfg, Complete),
|
|
|
|
|
|
E_GuideCompleteType.WaitPreparatShowComplete => new WaitPreparatShowComplete(Cfg, Complete),
|
2024-07-03 14:41:12 +08:00
|
|
|
|
E_GuideCompleteType.WaitEnemyRetreat => new WaitEnemyRetreatComplete(Cfg, Complete),
|
2024-07-03 18:30:08 +08:00
|
|
|
|
E_GuideCompleteType.WaitChangeName => new WaitChangeNameComplete(Cfg, Complete),
|
2024-07-04 13:21:28 +08:00
|
|
|
|
E_GuideCompleteType.WaitEditTeamComplete => new WaitEditTeamComplete(Cfg, Complete),
|
2024-07-04 14:40:00 +08:00
|
|
|
|
E_GuideCompleteType.AnyClickComplete => new AnyClickComplete(Cfg, Complete),
|
2024-07-05 20:49:03 +08:00
|
|
|
|
E_GuideCompleteType.SaveTeamComplete => new SaveTeamComplete(Cfg, Complete),
|
2024-07-09 15:53:50 +08:00
|
|
|
|
E_GuideCompleteType.JoinVehicle => new JoinVehicle(Cfg, Complete),
|
2024-10-15 19:40:57 +08:00
|
|
|
|
E_GuideCompleteType.WaitLoadingComplete => new WaitLoadingComplete(Cfg, Complete),
|
2024-10-15 20:05:34 +08:00
|
|
|
|
E_GuideCompleteType.ClearTeamComplete => new ClearTeamComplete(Cfg, Complete),
|
2024-10-16 17:40:49 +08:00
|
|
|
|
E_GuideCompleteType.SelectTeamComplete => new SelectTeamComplete(Cfg, Complete),
|
2024-10-16 19:02:03 +08:00
|
|
|
|
E_GuideCompleteType.SkillCDComplete => new SkillCDComplete(Cfg, Complete),
|
2024-10-17 19:06:35 +08:00
|
|
|
|
E_GuideCompleteType.WaitComplete => new WaitComplete(Cfg, Complete),
|
2024-10-29 17:59:00 +08:00
|
|
|
|
E_GuideCompleteType.SaveTeamAndCloseUI => new SaveTeamAndCloseUIComplete(Cfg, Complete),
|
2024-05-29 16:36:30 +08:00
|
|
|
|
_ => throw new Exception($"未处理类型:{Cfg.GuideCompleteType}"),
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 开始引导
|
|
|
|
|
|
/// </summary>
|
2024-10-28 14:22:54 +08:00
|
|
|
|
public async UniTask StartGuide()
|
2024-05-29 16:36:30 +08:00
|
|
|
|
{
|
2024-10-11 15:46:57 +08:00
|
|
|
|
GuideState = E_GuideState.Guiding;
|
2024-10-29 19:00:00 +08:00
|
|
|
|
isWait = true;
|
2024-10-11 15:46:57 +08:00
|
|
|
|
|
2024-06-04 15:13:16 +08:00
|
|
|
|
DebugUtil.Log($"<color=#00FA9A>开始id为{Cfg.Id}的引导,延迟{Cfg.StepStartDelay}秒开始</color>"); // #00FA9A绿色
|
2024-06-04 13:26:59 +08:00
|
|
|
|
|
2024-06-04 15:13:16 +08:00
|
|
|
|
await DoBeforeGuide();
|
2024-05-29 16:36:30 +08:00
|
|
|
|
|
2024-06-03 19:36:47 +08:00
|
|
|
|
await UniTask.Delay((int)(Cfg.StepStartDelay * 1000f)); // 延迟时间开始
|
2024-10-29 19:00:00 +08:00
|
|
|
|
isWait = false;
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
DoRealBeforeGuide();
|
2024-05-29 16:36:30 +08:00
|
|
|
|
|
2024-06-04 13:26:59 +08:00
|
|
|
|
DebugUtil.Log($"<color=#00FA9A>实际执行id为{Cfg.Id}的引导</color>"); // #00FA9A绿色
|
|
|
|
|
|
|
2024-06-03 19:36:47 +08:00
|
|
|
|
DoGuide();
|
2024-09-24 12:45:00 +08:00
|
|
|
|
|
2024-09-29 15:47:42 +08:00
|
|
|
|
CommonUtils.GuideStepBiEvent(Cfg.Id, 0); // BI打点
|
2024-10-29 19:00:00 +08:00
|
|
|
|
|
|
|
|
|
|
if (isComplete)
|
|
|
|
|
|
Complete();
|
2024-05-29 16:36:30 +08:00
|
|
|
|
}
|
2024-05-24 15:07:50 +08:00
|
|
|
|
|
2024-10-08 17:31:59 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 跳过当前步骤
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void SkipStep()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 完成引导
|
|
|
|
|
|
/// </summary>
|
2024-10-08 17:31:59 +08:00
|
|
|
|
protected void Complete()
|
2024-05-29 16:36:30 +08:00
|
|
|
|
{
|
2024-05-31 15:01:21 +08:00
|
|
|
|
if (!IsGuiding)
|
2024-05-29 16:36:30 +08:00
|
|
|
|
return;
|
|
|
|
|
|
|
2024-10-29 19:00:00 +08:00
|
|
|
|
if (isWait)
|
|
|
|
|
|
{
|
|
|
|
|
|
isComplete = true;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-29 16:36:30 +08:00
|
|
|
|
DebugUtil.Log($"<color=#00FA9A>完成id为{Cfg.Id}的引导</color>"); // #00FA9A绿色
|
2024-05-24 15:07:50 +08:00
|
|
|
|
|
2024-05-29 16:36:30 +08:00
|
|
|
|
GuideState = E_GuideState.Complete;
|
|
|
|
|
|
DoBeforeComplete();
|
2024-10-08 16:13:27 +08:00
|
|
|
|
RecoverState();
|
2024-05-29 16:36:30 +08:00
|
|
|
|
GuideManager.Instance.CompleteStep(this);
|
2024-09-24 12:45:00 +08:00
|
|
|
|
|
2024-09-29 15:47:42 +08:00
|
|
|
|
CommonUtils.GuideStepBiEvent(Cfg.Id, 1); // BI打点
|
|
|
|
|
|
CommonUtils.GuideStepBiEvent(Cfg.Id.ToString());
|
2024-05-29 16:36:30 +08:00
|
|
|
|
}
|
2024-05-24 15:07:50 +08:00
|
|
|
|
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 结束引导
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void EndGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!IsGuiding)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
completeBase.RemoveListener();
|
2024-10-11 17:17:54 +08:00
|
|
|
|
RecoverState();
|
2024-06-04 15:13:16 +08:00
|
|
|
|
GuideState = E_GuideState.Idle;
|
2024-05-29 16:36:30 +08:00
|
|
|
|
}
|
2024-06-03 19:36:47 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 引导开始之前
|
|
|
|
|
|
/// </summary>
|
2024-06-04 15:13:16 +08:00
|
|
|
|
protected virtual async UniTask DoBeforeGuide()
|
2024-06-03 19:36:47 +08:00
|
|
|
|
{
|
2024-10-08 16:13:27 +08:00
|
|
|
|
InputManager.Instance.IsEnable = false;
|
2024-06-04 15:13:16 +08:00
|
|
|
|
await UI_GuideController.Open();
|
|
|
|
|
|
|
2024-06-03 19:36:47 +08:00
|
|
|
|
completeBase.AddListener();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-08 16:13:27 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 引导实际开始之前
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
protected virtual void DoRealBeforeGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
InputManager.Instance.IsEnable = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-06-03 19:36:47 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 引导
|
|
|
|
|
|
/// </summary>
|
2024-10-08 16:13:27 +08:00
|
|
|
|
protected virtual void DoGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
SetGuideState();
|
|
|
|
|
|
}
|
2024-06-03 19:36:47 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 引导完成之前
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
protected virtual void DoBeforeComplete()
|
|
|
|
|
|
{
|
|
|
|
|
|
completeBase.RemoveListener();
|
2024-06-04 15:13:16 +08:00
|
|
|
|
|
|
|
|
|
|
UIManager.Instance.CloseWindow(UINameConst.UI_Guide);
|
2024-06-03 19:36:47 +08:00
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置引导状态
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
protected abstract void SetGuideState();
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 还原状态
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
protected abstract void RecoverState();
|
2024-05-22 19:08:14 +08:00
|
|
|
|
}
|
2024-05-24 15:07:50 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
#region 引导点击
|
2024-05-27 13:32:18 +08:00
|
|
|
|
/// <summary>
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// 点击按钮
|
2024-05-27 13:32:18 +08:00
|
|
|
|
/// </summary>
|
2024-05-29 16:36:30 +08:00
|
|
|
|
internal sealed class ClickButtonStep : GuideStepBase
|
2024-05-27 15:39:03 +08:00
|
|
|
|
{
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// UI名
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string uiName;
|
2024-10-12 12:53:47 +08:00
|
|
|
|
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按钮路径
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string buttonPath;
|
|
|
|
|
|
|
|
|
|
|
|
public ClickButtonStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
if (Cfg.GuideTypeParams.Length <= 1)
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},参数数量错误:1.UI名,2.按钮路径");
|
2024-05-27 13:32:18 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
uiName = Cfg.GuideTypeParams[0];
|
|
|
|
|
|
buttonPath = Cfg.GuideTypeParams[1];
|
2024-05-29 16:36:30 +08:00
|
|
|
|
}
|
2024-05-27 13:32:18 +08:00
|
|
|
|
|
2024-05-29 16:36:30 +08:00
|
|
|
|
protected override async void DoGuide()
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
2024-07-02 14:23:13 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
await UI_GuideController.Open(UI_GuideController.E_GuideArrowType.Button, uiName, buttonPath, Cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
2024-10-12 12:46:58 +08:00
|
|
|
|
GuideManager.Instance.SkipAllGuide();
|
2024-10-10 13:59:48 +08:00
|
|
|
|
}
|
2024-07-02 16:05:37 +08:00
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
2024-10-23 15:46:30 +08:00
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Level_0);
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
2024-10-23 15:46:30 +08:00
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.DEFAULT_SPEED);
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
2024-07-02 16:05:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-02 19:29:18 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 滑动按钮
|
|
|
|
|
|
/// </summary>
|
2024-07-02 16:05:37 +08:00
|
|
|
|
internal sealed class SliderButtonStep : GuideStepBase
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// UI名
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string uiName;
|
2024-10-12 12:53:47 +08:00
|
|
|
|
|
2024-07-02 16:05:37 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按钮路径
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string buttonPath;
|
2024-10-12 12:53:47 +08:00
|
|
|
|
|
2024-07-08 19:00:06 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 地板索引
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly int floorIndex;
|
2024-07-02 16:05:37 +08:00
|
|
|
|
|
|
|
|
|
|
public SliderButtonStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
if (Cfg.GuideTypeParams.Length <= 1)
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},参数数量错误:1.UI名,2.按钮路径,3(可选).地板索引");
|
2024-07-02 16:05:37 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
uiName = Cfg.GuideTypeParams[0];
|
|
|
|
|
|
buttonPath = Cfg.GuideTypeParams[1];
|
2024-07-08 19:00:06 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
if (Cfg.GuideTypeParams.Length > 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (int.TryParse(Cfg.GuideTypeParams[2], out int index))
|
|
|
|
|
|
floorIndex = index;
|
|
|
|
|
|
else
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},第3个参数类型错误:应该为int类型");
|
|
|
|
|
|
}
|
2024-07-02 16:05:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override async void DoGuide()
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
2024-07-02 16:05:37 +08:00
|
|
|
|
|
2024-10-12 12:53:47 +08:00
|
|
|
|
await UI_GuideController.Open(UI_GuideController.E_GuideArrowType.SliderButton, uiName, buttonPath, Cfg,
|
|
|
|
|
|
floorIndex);
|
2024-10-10 13:59:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
2024-05-29 16:36:30 +08:00
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
2024-10-23 15:46:30 +08:00
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Level_0);
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
2024-10-23 15:46:30 +08:00
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.DEFAULT_SPEED);
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
2024-05-27 15:39:03 +08:00
|
|
|
|
}
|
2024-05-27 13:32:18 +08:00
|
|
|
|
|
2024-07-01 13:08:37 +08:00
|
|
|
|
/// <summary>
|
2024-07-03 14:56:11 +08:00
|
|
|
|
/// 点击地板
|
2024-07-01 13:08:37 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
internal sealed class ClickFloorStep : GuideStepBase
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 底板索引
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly int floorIndex;
|
|
|
|
|
|
|
|
|
|
|
|
public ClickFloorStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
if (Cfg.GuideTypeParams.Length <= 0)
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},参数数量错误:1.地板索引");
|
2024-07-01 13:08:37 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
if (int.TryParse(Cfg.GuideTypeParams[0], out int index))
|
2024-07-01 13:08:37 +08:00
|
|
|
|
floorIndex = index;
|
2024-10-10 13:59:48 +08:00
|
|
|
|
else
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},第1个参数类型错误:应该为int类型");
|
2024-07-01 13:08:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override async void DoGuide()
|
2024-10-08 16:13:27 +08:00
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
await UI_GuideController.Open(floorIndex, Cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
2024-07-01 13:08:37 +08:00
|
|
|
|
{
|
2024-07-03 14:56:11 +08:00
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
2024-10-23 15:46:30 +08:00
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Level_0);
|
2024-07-03 14:56:11 +08:00
|
|
|
|
|
2024-09-06 14:44:11 +08:00
|
|
|
|
UIRoot.Instance.IsEnableGraphicRaycasterByGuide(false);
|
2024-07-03 14:07:54 +08:00
|
|
|
|
GuideManager.Instance.IsControlFloor = true;
|
2024-07-01 13:08:37 +08:00
|
|
|
|
GuideManager.Instance.FloorIndex = floorIndex;
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
2024-07-03 14:56:11 +08:00
|
|
|
|
|
2024-10-08 16:13:27 +08:00
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.isInBattle)
|
|
|
|
|
|
{
|
2024-10-17 18:27:11 +08:00
|
|
|
|
if (GuideManager.Instance.IsUseSkillSuccess)
|
2024-10-23 15:46:30 +08:00
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.DEFAULT_SPEED);
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
UIRoot.Instance.IsEnableGraphicRaycasterByGuide(true);
|
|
|
|
|
|
GuideManager.Instance.IsControlFloor = false;
|
|
|
|
|
|
GuideManager.Instance.FloorIndex = -1;
|
2024-07-01 13:08:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-10 16:05:12 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 指向UI说明
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
internal sealed class NoteStep : GuideStepBase
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// UI名
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string uiName;
|
2024-10-12 12:53:47 +08:00
|
|
|
|
|
2024-10-10 16:05:12 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按钮路径
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string buttonPath;
|
|
|
|
|
|
|
|
|
|
|
|
public NoteStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Cfg.GuideTypeParams.Length > 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
uiName = cfg.GuideTypeParams[0];
|
|
|
|
|
|
buttonPath = cfg.GuideTypeParams[1];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override async void DoGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
|
|
|
|
|
|
|
|
|
|
|
await UI_GuideController.Open(UI_GuideController.E_GuideArrowType.UI, uiName, buttonPath, Cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
2024-10-23 15:46:30 +08:00
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Level_0);
|
2024-10-10 16:05:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
2024-10-23 15:46:30 +08:00
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.DEFAULT_SPEED);
|
2024-10-10 16:05:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-12 12:53:47 +08:00
|
|
|
|
|
2024-10-16 13:02:48 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 滑动按钮上阵
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
internal sealed class SliderButtonBattleStep : GuideStepBase
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// UI名
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string uiName;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按钮路径
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string buttonPath;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 地板索引
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly int floorIndex;
|
|
|
|
|
|
|
|
|
|
|
|
public SliderButtonBattleStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Cfg.GuideTypeParams.Length <= 1)
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},参数数量错误:1.UI名,2.按钮路径,3(可选).地板索引");
|
|
|
|
|
|
|
|
|
|
|
|
uiName = Cfg.GuideTypeParams[0];
|
|
|
|
|
|
buttonPath = Cfg.GuideTypeParams[1];
|
|
|
|
|
|
|
|
|
|
|
|
if (Cfg.GuideTypeParams.Length > 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (int.TryParse(Cfg.GuideTypeParams[2], out int index))
|
|
|
|
|
|
floorIndex = index;
|
|
|
|
|
|
else
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},第3个参数类型错误:应该为int类型");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override async void DoGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
|
|
|
|
|
|
|
|
|
|
|
await UI_GuideController.Open(UI_GuideController.E_GuideArrowType.SliderButton, uiName, buttonPath, Cfg,
|
|
|
|
|
|
floorIndex);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
2024-10-23 15:46:30 +08:00
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Level_0);
|
2024-10-16 13:39:24 +08:00
|
|
|
|
|
|
|
|
|
|
GuideManager.Instance.IsControlFloor = true;
|
|
|
|
|
|
GuideManager.Instance.FloorIndex = floorIndex;
|
|
|
|
|
|
|
|
|
|
|
|
EventManager.Instance.Register(EventManager.EventName.Guide_CancelModeFight, OnCancelFightModel);
|
2024-10-16 13:02:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
2024-10-16 13:39:24 +08:00
|
|
|
|
EventManager.Instance.Unregister(EventManager.EventName.Guide_CancelModeFight, OnCancelFightModel);
|
|
|
|
|
|
|
2024-10-23 15:46:30 +08:00
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.DEFAULT_SPEED);
|
2024-10-16 13:39:24 +08:00
|
|
|
|
|
|
|
|
|
|
GuideManager.Instance.IsControlFloor = false;
|
|
|
|
|
|
GuideManager.Instance.FloorIndex = -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async void OnCancelFightModel()
|
|
|
|
|
|
{
|
2024-10-17 14:18:19 +08:00
|
|
|
|
await UniTask.Delay(300);
|
2024-10-16 13:39:24 +08:00
|
|
|
|
await UI_GuideController.Open(UI_GuideController.E_GuideArrowType.SliderButton, uiName, buttonPath, Cfg, floorIndex);
|
2024-10-16 13:02:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-28 14:22:54 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 滑动按钮使用技能
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
internal sealed class SliderButtonUseSkillStep : GuideStepBase
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// UI名
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string uiName;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按钮路径
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string buttonPath;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 地板索引
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly int floorIndex;
|
|
|
|
|
|
|
|
|
|
|
|
public SliderButtonUseSkillStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Cfg.GuideTypeParams.Length <= 1)
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},参数数量错误:1.UI名,2.按钮路径,3(可选).地板索引");
|
|
|
|
|
|
|
|
|
|
|
|
uiName = Cfg.GuideTypeParams[0];
|
|
|
|
|
|
buttonPath = Cfg.GuideTypeParams[1];
|
|
|
|
|
|
|
|
|
|
|
|
if (Cfg.GuideTypeParams.Length > 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (int.TryParse(Cfg.GuideTypeParams[2], out int index))
|
|
|
|
|
|
floorIndex = index;
|
|
|
|
|
|
else
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},第3个参数类型错误:应该为int类型");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override async void DoGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
|
|
|
|
|
|
|
|
|
|
|
await UI_GuideController.Open(UI_GuideController.E_GuideArrowType.SliderButton, uiName, buttonPath, Cfg,
|
|
|
|
|
|
floorIndex);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Level_0);
|
|
|
|
|
|
|
|
|
|
|
|
GuideManager.Instance.IsControlFloor = true;
|
|
|
|
|
|
GuideManager.Instance.FloorIndex = floorIndex;
|
|
|
|
|
|
|
|
|
|
|
|
EventManager.Instance.Register(EventManager.EventName.UI_SKILL_CANCEL, OnCancelUseSkill);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
EventManager.Instance.Unregister(EventManager.EventName.UI_SKILL_CANCEL, OnCancelUseSkill);
|
|
|
|
|
|
|
|
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.DEFAULT_SPEED);
|
|
|
|
|
|
|
|
|
|
|
|
GuideManager.Instance.IsControlFloor = false;
|
|
|
|
|
|
GuideManager.Instance.FloorIndex = -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async void OnCancelUseSkill()
|
|
|
|
|
|
{
|
|
|
|
|
|
AreaManager.instance.LogicUpdate(0);
|
|
|
|
|
|
await UniTask.Delay(300);
|
|
|
|
|
|
|
|
|
|
|
|
await UI_GuideController.Open(UI_GuideController.E_GuideArrowType.SliderButton, uiName, buttonPath, Cfg, floorIndex);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-28 14:45:29 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 滑动按钮使用指挥官技能
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
internal sealed class SliderButtonUsePlayerSkillStep : GuideStepBase
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// UI名
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string uiName;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按钮路径
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string buttonPath;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 地板索引
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly int floorIndex;
|
|
|
|
|
|
|
|
|
|
|
|
public SliderButtonUsePlayerSkillStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Cfg.GuideTypeParams.Length <= 1)
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},参数数量错误:1.UI名,2.按钮路径,3(可选).地板索引");
|
|
|
|
|
|
|
|
|
|
|
|
uiName = Cfg.GuideTypeParams[0];
|
|
|
|
|
|
buttonPath = Cfg.GuideTypeParams[1];
|
|
|
|
|
|
|
|
|
|
|
|
if (Cfg.GuideTypeParams.Length > 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (int.TryParse(Cfg.GuideTypeParams[2], out int index))
|
|
|
|
|
|
floorIndex = index;
|
|
|
|
|
|
else
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},第3个参数类型错误:应该为int类型");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override async void DoGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
|
|
|
|
|
|
|
|
|
|
|
await UI_GuideController.Open(UI_GuideController.E_GuideArrowType.SliderButton, uiName, buttonPath, Cfg,
|
|
|
|
|
|
floorIndex);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Level_0);
|
|
|
|
|
|
|
|
|
|
|
|
GuideManager.Instance.IsControlFloor = true;
|
|
|
|
|
|
GuideManager.Instance.FloorIndex = floorIndex;
|
|
|
|
|
|
|
|
|
|
|
|
EventManager.Instance.Register(EventManager.EventName.Guide_CancelPlayerSkill, OnCancelUseSkill);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
EventManager.Instance.Unregister(EventManager.EventName.Guide_CancelPlayerSkill, OnCancelUseSkill);
|
|
|
|
|
|
|
|
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.DEFAULT_SPEED);
|
|
|
|
|
|
|
|
|
|
|
|
GuideManager.Instance.IsControlFloor = false;
|
|
|
|
|
|
GuideManager.Instance.FloorIndex = -1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async void OnCancelUseSkill()
|
|
|
|
|
|
{
|
|
|
|
|
|
SkillManager.instance.playerSkillManager.LogicUpdate(0);
|
|
|
|
|
|
AreaManager.instance.LogicUpdate(0);
|
|
|
|
|
|
await UniTask.Delay(300);
|
|
|
|
|
|
|
|
|
|
|
|
await UI_GuideController.Open(UI_GuideController.E_GuideArrowType.SliderButton, uiName, buttonPath, Cfg, floorIndex);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
#endregion
|
2024-07-01 13:08:37 +08:00
|
|
|
|
|
2024-05-24 15:07:50 +08:00
|
|
|
|
/// <summary>
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// 播放视频
|
2024-05-24 15:07:50 +08:00
|
|
|
|
/// </summary>
|
2024-05-29 16:36:30 +08:00
|
|
|
|
internal sealed class PlayVideoStep : GuideStepBase
|
2024-05-24 15:07:50 +08:00
|
|
|
|
{
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 视频路径
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string videoPath;
|
2024-05-24 15:07:50 +08:00
|
|
|
|
|
2024-05-29 16:36:30 +08:00
|
|
|
|
public PlayVideoStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
if (Cfg.GuideTypeParams.Length <= 0)
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},参数数量错误:1.视频路径");
|
2024-05-24 15:07:50 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
videoPath = Cfg.GuideTypeParams[0];
|
2024-05-29 16:36:30 +08:00
|
|
|
|
}
|
2024-05-27 15:39:03 +08:00
|
|
|
|
|
2024-05-29 16:36:30 +08:00
|
|
|
|
protected override async void DoGuide()
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
2024-10-18 18:13:23 +08:00
|
|
|
|
GuideManager.Instance.IsPlayPVVideo = true;
|
2024-10-30 16:24:19 +08:00
|
|
|
|
await UI_PVAnimaPlayController.Open(videoPath, () =>
|
|
|
|
|
|
{
|
|
|
|
|
|
GameStateManager.Instance.ChangeState(new GameStateMainScene());
|
|
|
|
|
|
});
|
2024-10-18 18:35:17 +08:00
|
|
|
|
Complete();
|
2024-10-10 13:59:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
2024-05-29 16:36:30 +08:00
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
2024-05-24 15:07:50 +08:00
|
|
|
|
}
|
2024-05-29 13:04:51 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-10-15 18:17:40 +08:00
|
|
|
|
/// 显示引导提示
|
2024-05-29 13:04:51 +08:00
|
|
|
|
/// </summary>
|
2024-10-15 18:17:40 +08:00
|
|
|
|
internal sealed class ShowGuideTipStep : GuideStepBase
|
2024-05-29 13:04:51 +08:00
|
|
|
|
{
|
2024-10-15 18:17:40 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 引导提示配置id
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly int guideTipCfgId;
|
|
|
|
|
|
|
|
|
|
|
|
public ShowGuideTipStep(DataGuideCfg cfg) : base(cfg)
|
2024-05-29 16:36:30 +08:00
|
|
|
|
{
|
2024-10-15 18:17:40 +08:00
|
|
|
|
if (Cfg.GuideTypeParams.Length <= 0)
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},参数数量错误:1.引导Tip的Id");
|
|
|
|
|
|
|
|
|
|
|
|
if (int.TryParse(Cfg.GuideTypeParams[0], out int id))
|
|
|
|
|
|
guideTipCfgId = id;
|
|
|
|
|
|
else
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},第1个参数类型错误:应该为int类型");
|
2024-05-29 16:36:30 +08:00
|
|
|
|
}
|
2024-05-29 13:04:51 +08:00
|
|
|
|
|
2024-10-15 18:17:40 +08:00
|
|
|
|
protected override async void DoGuide()
|
2024-05-29 16:36:30 +08:00
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
2024-10-15 18:17:40 +08:00
|
|
|
|
await UI_GuideTipController.Open(guideTipCfgId);
|
2024-10-10 13:59:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
2024-05-29 16:36:30 +08:00
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
2024-10-23 15:46:30 +08:00
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Level_0);
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
2024-10-23 15:46:30 +08:00
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.DEFAULT_SPEED);
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
2024-05-29 13:04:51 +08:00
|
|
|
|
}
|
2024-05-22 19:08:14 +08:00
|
|
|
|
|
2024-10-15 18:17:40 +08:00
|
|
|
|
#region 进入流程
|
2024-05-27 15:39:03 +08:00
|
|
|
|
/// <summary>
|
2024-10-15 18:17:40 +08:00
|
|
|
|
/// 切换主场景状态
|
2024-05-27 15:39:03 +08:00
|
|
|
|
/// </summary>
|
2024-10-15 18:17:40 +08:00
|
|
|
|
internal sealed class EnterMainStateStep : GuideStepBase
|
2024-05-22 19:08:14 +08:00
|
|
|
|
{
|
2024-10-15 18:17:40 +08:00
|
|
|
|
public EnterMainStateStep(DataGuideCfg cfg) : base(cfg)
|
2024-05-29 16:36:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
}
|
2024-05-28 18:47:23 +08:00
|
|
|
|
|
2024-10-15 18:17:40 +08:00
|
|
|
|
protected override void DoGuide()
|
2024-05-29 16:36:30 +08:00
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
2024-10-15 18:17:40 +08:00
|
|
|
|
GameStateManager.Instance.ChangeState(new GameStateMainScene());
|
2024-10-10 13:59:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
2024-05-29 16:36:30 +08:00
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
2024-05-24 15:07:50 +08:00
|
|
|
|
}
|
2024-05-22 19:08:14 +08:00
|
|
|
|
|
2024-05-24 15:07:50 +08:00
|
|
|
|
/// <summary>
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// 进入关卡
|
2024-05-24 15:07:50 +08:00
|
|
|
|
/// </summary>
|
2024-05-29 16:36:30 +08:00
|
|
|
|
internal sealed class EnterLevelStep : GuideStepBase
|
2024-05-24 15:07:50 +08:00
|
|
|
|
{
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 关卡id
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly int levelId;
|
2024-10-12 12:53:47 +08:00
|
|
|
|
|
2024-06-27 13:22:21 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 进入故事关卡后是否立即播放
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly bool isPlay;
|
2024-05-24 15:07:50 +08:00
|
|
|
|
|
2024-05-29 16:36:30 +08:00
|
|
|
|
public EnterLevelStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
2024-06-27 13:22:21 +08:00
|
|
|
|
if (Cfg.GuideTypeParams.Length < 1)
|
2024-10-10 13:59:48 +08:00
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},参数数量错误:1.关卡id");
|
2024-05-27 13:32:18 +08:00
|
|
|
|
|
2024-05-29 16:36:30 +08:00
|
|
|
|
if (int.TryParse(Cfg.GuideTypeParams[0], out int id))
|
|
|
|
|
|
levelId = id;
|
2024-10-10 13:59:48 +08:00
|
|
|
|
else
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},第1个参数类型错误:应该为int类型");
|
2024-06-27 13:22:21 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
if (Cfg.GuideTypeParams.Length > 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (bool.TryParse(Cfg.GuideTypeParams[1], out bool isPlay))
|
|
|
|
|
|
this.isPlay = isPlay;
|
|
|
|
|
|
else
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},第2个参数类型错误:应该为bool类型");
|
|
|
|
|
|
}
|
2024-06-27 13:22:21 +08:00
|
|
|
|
else
|
2024-10-10 13:59:48 +08:00
|
|
|
|
isPlay = true;
|
2024-05-29 16:36:30 +08:00
|
|
|
|
}
|
2024-05-27 13:32:18 +08:00
|
|
|
|
|
2024-06-03 19:52:28 +08:00
|
|
|
|
protected override void DoGuide()
|
2024-05-29 16:36:30 +08:00
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
LevelManager.Instance.TryEnterLevel(levelId, null, null, isPlay);
|
|
|
|
|
|
}
|
2024-10-12 12:46:58 +08:00
|
|
|
|
catch (Exception e)
|
2024-10-10 13:59:48 +08:00
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
2024-10-12 12:46:58 +08:00
|
|
|
|
GuideManager.Instance.ShowSkipAllGuide();
|
2024-10-10 13:59:48 +08:00
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
2024-05-29 16:36:30 +08:00
|
|
|
|
}
|
2024-05-27 13:32:18 +08:00
|
|
|
|
}
|
2024-05-28 13:40:44 +08:00
|
|
|
|
|
2024-10-15 18:17:40 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 进入编队
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
internal sealed class EnterEnterEditTeam : GuideStepBase
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 关卡id
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly int levelId;
|
|
|
|
|
|
|
|
|
|
|
|
public EnterEnterEditTeam(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Cfg.GuideTypeParams.Length < 1)
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},参数数量错误:1.关卡id");
|
|
|
|
|
|
|
|
|
|
|
|
if (int.TryParse(Cfg.GuideTypeParams[0], out int id))
|
|
|
|
|
|
levelId = id;
|
|
|
|
|
|
else
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},第1个参数类型错误:应该为int类型");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void DoGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
|
|
|
|
|
|
2024-10-30 16:58:42 +08:00
|
|
|
|
GameStateManager.Instance.ChangeState(new GameStateMainScene(false, false, async () =>
|
2024-10-15 18:17:40 +08:00
|
|
|
|
{
|
2024-10-15 18:48:43 +08:00
|
|
|
|
await JumpToManager.JumpFuncAsync(cfg.JumpFuncType.TeamSelect, levelId);
|
2024-10-15 18:17:40 +08:00
|
|
|
|
}));
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-18 13:31:45 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 进入队伍信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
internal sealed class EnterEnterTeamInfo : GuideStepBase
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 关卡id
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly int levelId;
|
|
|
|
|
|
|
|
|
|
|
|
public EnterEnterTeamInfo(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Cfg.GuideTypeParams.Length < 1)
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},参数数量错误:1.关卡id");
|
|
|
|
|
|
|
|
|
|
|
|
if (int.TryParse(Cfg.GuideTypeParams[0], out int id))
|
|
|
|
|
|
levelId = id;
|
|
|
|
|
|
else
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},第1个参数类型错误:应该为int类型");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void DoGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
|
|
|
|
|
|
2024-10-30 16:58:42 +08:00
|
|
|
|
GameStateManager.Instance.ChangeState(new GameStateMainScene(false, false, async () =>
|
2024-10-18 13:31:45 +08:00
|
|
|
|
{
|
|
|
|
|
|
await JumpToManager.JumpFuncAsync(cfg.JumpFuncType.TeamInfoByGuide, levelId);
|
|
|
|
|
|
}));
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-15 18:17:40 +08:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2024-05-28 13:40:44 +08:00
|
|
|
|
/// <summary>
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// 关卡上阵
|
2024-05-28 13:40:44 +08:00
|
|
|
|
/// </summary>
|
2024-05-29 16:36:30 +08:00
|
|
|
|
internal sealed class LevelEmbattleStep : GuideStepBase
|
2024-05-28 13:40:44 +08:00
|
|
|
|
{
|
2024-05-29 16:36:30 +08:00
|
|
|
|
public LevelEmbattleStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
2024-05-28 13:40:44 +08:00
|
|
|
|
|
2024-06-04 18:27:32 +08:00
|
|
|
|
protected override async UniTask DoBeforeGuide()
|
2024-05-29 16:36:30 +08:00
|
|
|
|
{
|
2024-06-04 18:27:32 +08:00
|
|
|
|
await base.DoBeforeGuide();
|
|
|
|
|
|
|
|
|
|
|
|
UIWindow uiWindow = UIManager.Instance.GetOpenedWindowByPath<UIWindow>(UINameConst.UI_StartBtn_CMSBtn);
|
|
|
|
|
|
if (null == uiWindow)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
Transform ts = uiWindow.gameObject.transform.Find("UIStartBtn/Image_UI_Start_BG/Button_StartBtn");
|
|
|
|
|
|
if (null == ts)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
Button btn = ts.GetComponent<Button>();
|
|
|
|
|
|
if (null == btn)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
btn.interactable = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void DoBeforeComplete()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoBeforeComplete();
|
|
|
|
|
|
|
|
|
|
|
|
UIWindow uiWindow = UIManager.Instance.GetOpenedWindowByPath<UIWindow>(UINameConst.UI_StartBtn_CMSBtn);
|
|
|
|
|
|
if (null == uiWindow)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
Transform ts = uiWindow.gameObject.transform.Find("UIStartBtn/Image_UI_Start_BG/Button_StartBtn");
|
|
|
|
|
|
if (null == ts)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
Button btn = ts.GetComponent<Button>();
|
|
|
|
|
|
if (null == btn)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
btn.interactable = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override async void DoGuide()
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
await UI_GuideController.Open(Cfg, false);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
2024-05-30 16:49:27 +08:00
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
2024-05-30 16:49:27 +08:00
|
|
|
|
}
|
2024-05-31 14:06:02 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 等待关卡结束
|
|
|
|
|
|
/// </summary>
|
2024-06-04 15:13:16 +08:00
|
|
|
|
internal sealed class WaitLevelOver : GuideStepBase
|
2024-05-31 14:06:02 +08:00
|
|
|
|
{
|
|
|
|
|
|
private readonly bool isContinue;
|
|
|
|
|
|
|
2024-06-04 15:13:16 +08:00
|
|
|
|
public WaitLevelOver(DataGuideCfg cfg) : base(cfg)
|
2024-05-31 14:06:02 +08:00
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
if (Cfg.GuideTypeParams.Length <= 0)
|
2024-10-16 14:27:06 +08:00
|
|
|
|
isContinue = false;
|
|
|
|
|
|
else if (Cfg.GuideTypeParams.Length > 0 && bool.TryParse(Cfg.GuideTypeParams[0], out bool isContinue))
|
2024-05-31 14:06:02 +08:00
|
|
|
|
this.isContinue = isContinue;
|
2024-10-10 13:59:48 +08:00
|
|
|
|
else
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},第1个参数类型错误:应该为bool类型");
|
2024-05-31 14:06:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void DoGuide()
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
2024-06-03 16:48:18 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
UIManager.Instance.CloseWindow(UINameConst.UI_Guide);
|
2024-10-23 15:46:30 +08:00
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.DEFAULT_SPEED);
|
2024-10-10 13:59:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
2024-10-11 19:22:18 +08:00
|
|
|
|
LevelManager.Instance.ExitLevelChangeMainFunc = () => { return isContinue; };
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
2024-06-03 16:48:18 +08:00
|
|
|
|
|
2024-10-08 16:13:27 +08:00
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
2024-10-11 19:22:18 +08:00
|
|
|
|
LevelManager.Instance.ExitLevelChangeMainFunc = null;
|
2024-06-03 16:48:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-06-20 16:36:40 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 打开选择角色形象UI
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
internal sealed class OpenChoosePersonStep : GuideStepBase
|
|
|
|
|
|
{
|
|
|
|
|
|
public OpenChoosePersonStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override async void DoGuide()
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
await UI_ChoosePersonController.Open();
|
|
|
|
|
|
await UI_GuideController.Open(Cfg, false);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
2024-06-20 16:36:40 +08:00
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
2024-06-20 16:36:40 +08:00
|
|
|
|
}
|
2024-07-01 16:19:07 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 等待步骤
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
internal sealed class WaitStep : GuideStepBase
|
|
|
|
|
|
{
|
2024-07-03 18:34:47 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否有遮罩
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly bool isFullMask;
|
|
|
|
|
|
|
2024-07-01 16:19:07 +08:00
|
|
|
|
public WaitStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
if (Cfg.GuideTypeParams.Length <= 0)
|
2024-07-03 18:34:47 +08:00
|
|
|
|
isFullMask = true;
|
2024-10-10 13:59:48 +08:00
|
|
|
|
else if (bool.TryParse(Cfg.GuideTypeParams[0], out bool isMask))
|
2024-07-03 18:34:47 +08:00
|
|
|
|
isFullMask = isMask;
|
2024-10-10 13:59:48 +08:00
|
|
|
|
else
|
|
|
|
|
|
isFullMask = false;
|
2024-07-01 16:19:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-03 18:34:47 +08:00
|
|
|
|
protected override async void DoGuide()
|
2024-07-01 16:19:07 +08:00
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
await UI_GuideController.Open(isFullMask);
|
2024-10-17 19:06:35 +08:00
|
|
|
|
EventManager.Instance.Send(EventManager.EventName.Guide_Wait);
|
2024-10-10 13:59:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
2024-07-01 16:19:07 +08:00
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
2024-07-01 16:19:07 +08:00
|
|
|
|
}
|
2024-07-03 19:21:42 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 等待打开改名事件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
internal sealed class WaitOpenChangeName : GuideStepBase
|
|
|
|
|
|
{
|
|
|
|
|
|
public WaitOpenChangeName(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override async void DoGuide()
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
await UI_GuideController.Open(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
2024-07-03 19:21:42 +08:00
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
GuideManager.Instance.IsChangeName = false;
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
GuideManager.Instance.IsChangeName = true;
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
2024-07-03 19:21:42 +08:00
|
|
|
|
}
|
2024-07-04 13:21:28 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 等待玩家编队
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
internal sealed class WaitEditTeamStep : GuideStepBase
|
|
|
|
|
|
{
|
|
|
|
|
|
public WaitEditTeamStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override async void DoGuide()
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
2024-10-10 13:59:48 +08:00
|
|
|
|
await UI_GuideController.Open(Cfg, false);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
2024-07-04 13:21:28 +08:00
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
GuideManager.Instance.IsEditTeamGuide = true;
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
GuideManager.Instance.IsEditTeamGuide = false;
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
2024-07-04 13:21:28 +08:00
|
|
|
|
}
|
2024-07-04 14:40:00 +08:00
|
|
|
|
|
2024-10-16 17:40:49 +08:00
|
|
|
|
#region 编队相关
|
2024-07-05 20:49:03 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 保存默认编队
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
internal sealed class SaveDefaultTeamStep : GuideStepBase
|
|
|
|
|
|
{
|
|
|
|
|
|
public SaveDefaultTeamStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void DoGuide()
|
|
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
try
|
2024-07-05 20:49:03 +08:00
|
|
|
|
{
|
2024-10-10 13:59:48 +08:00
|
|
|
|
base.DoGuide();
|
|
|
|
|
|
|
2024-10-16 17:40:49 +08:00
|
|
|
|
Team team = TeamEditManager.Instance.GetTeamByIndex(1); // 获取第二个队伍
|
2024-10-10 13:59:48 +08:00
|
|
|
|
if (null == team)
|
|
|
|
|
|
return;
|
2024-10-12 12:53:47 +08:00
|
|
|
|
|
2024-10-16 17:40:49 +08:00
|
|
|
|
team.ClearTeam();
|
2024-10-17 12:33:34 +08:00
|
|
|
|
uint[] characters = new uint[] { 0, 0, 0, 0 };
|
2024-10-10 13:59:48 +08:00
|
|
|
|
|
2024-10-16 19:02:03 +08:00
|
|
|
|
uint defaultCommander = 100001u;
|
2024-10-11 15:22:03 +08:00
|
|
|
|
|
2024-10-15 16:30:20 +08:00
|
|
|
|
Team newTeam = new(team.TeamIndex,
|
2024-10-10 13:59:48 +08:00
|
|
|
|
team.Name,
|
|
|
|
|
|
team.IconNumber,
|
2024-10-11 19:51:43 +08:00
|
|
|
|
defaultCommander,
|
2024-10-11 15:22:03 +08:00
|
|
|
|
characters.ToList(),
|
|
|
|
|
|
team.GetPlayerSkillIDs());
|
2024-10-10 13:59:48 +08:00
|
|
|
|
|
2024-10-15 16:30:20 +08:00
|
|
|
|
TeamEditManager.Instance.SaveTeam(newTeam);
|
2024-10-10 13:59:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
2024-07-05 20:49:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
2024-07-05 20:49:03 +08:00
|
|
|
|
}
|
2024-10-15 20:05:34 +08:00
|
|
|
|
|
2024-10-16 17:40:49 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 队伍选择
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
internal sealed class SelectTeamStep : GuideStepBase
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 选择的队伍索引
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly int teamIndex;
|
|
|
|
|
|
|
|
|
|
|
|
public SelectTeamStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Cfg.GuideTypeParams.Length < 1)
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},参数数量错误:1.队伍索引");
|
|
|
|
|
|
|
|
|
|
|
|
if (int.TryParse(Cfg.GuideTypeParams[0], out int index))
|
|
|
|
|
|
teamIndex = index;
|
|
|
|
|
|
else
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},第1个参数类型错误:应该为int类型");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void DoGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
|
|
|
|
|
|
|
|
|
|
|
TeamEditManager.Instance.SetSelectTeam(teamIndex);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-10-15 20:05:34 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 清除编队
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
internal sealed class ClearTeamStep : GuideStepBase
|
|
|
|
|
|
{
|
|
|
|
|
|
public ClearTeamStep(DataGuideCfg cfg) : base(cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void DoGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
|
|
|
|
|
|
|
|
|
|
|
Team team = TeamEditManager.Instance.GetSelectTeam();
|
|
|
|
|
|
if (null == team)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
team.ClearTeam();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-16 17:40:49 +08:00
|
|
|
|
#endregion
|
2024-05-22 19:08:14 +08:00
|
|
|
|
}
|