2024-05-22 19:08:14 +08:00
|
|
|
|
using cfg.GuideCfg;
|
2024-05-24 15:07:50 +08:00
|
|
|
|
using System;
|
2024-05-27 13:32:18 +08:00
|
|
|
|
using Cysharp.Threading.Tasks;
|
2024-05-29 16:36:30 +08:00
|
|
|
|
using Gameplay.Level;
|
2024-07-05 20:49:03 +08:00
|
|
|
|
using Framework;
|
2025-04-08 14:07:20 +08:00
|
|
|
|
using Gameplay.Unit;
|
|
|
|
|
|
using Framework.Condition;
|
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
|
|
|
|
{
|
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>
|
2025-04-08 14:07:20 +08:00
|
|
|
|
/// 是否等待中
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private bool isWaiting;
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 完成标记
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// </summary>
|
2024-10-29 19:00:00 +08:00
|
|
|
|
private bool isComplete;
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// <summary>
|
2025-04-08 14:07:20 +08:00
|
|
|
|
/// 引导状态
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// </summary>
|
2025-04-08 14:07:20 +08:00
|
|
|
|
private E_GuideState guideState;
|
2024-05-29 16:36:30 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-04-08 14:07:20 +08:00
|
|
|
|
/// 引导配置
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// </summary>
|
2025-04-08 14:07:20 +08:00
|
|
|
|
public DataGuideCfg Cfg { get; private set; }
|
2024-05-29 16:36:30 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 是否引导中
|
|
|
|
|
|
/// </summary>
|
2025-04-08 14:07:20 +08:00
|
|
|
|
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;
|
|
|
|
|
|
|
2025-04-08 14:07:20 +08:00
|
|
|
|
guideState = E_GuideState.Idle;
|
|
|
|
|
|
isWaiting = true;
|
2024-10-29 19:00:00 +08:00
|
|
|
|
isComplete = false;
|
2024-05-29 16:36:30 +08:00
|
|
|
|
|
2025-04-08 14:07:20 +08:00
|
|
|
|
ConditionReactor.Instance.AddReaction(cfg.CompleteCondition, OnCompleteByCondition);
|
2024-05-29 16:36:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 开始引导
|
|
|
|
|
|
/// </summary>
|
2025-04-08 14:07:20 +08:00
|
|
|
|
public async void StartGuide()
|
2024-05-29 16:36:30 +08:00
|
|
|
|
{
|
2025-04-08 14:07:20 +08:00
|
|
|
|
guideState = E_GuideState.Guiding;
|
|
|
|
|
|
isWaiting = true;
|
2024-10-11 15:46:57 +08:00
|
|
|
|
|
2025-04-08 16:03:25 +08:00
|
|
|
|
GuideManager.Debug($"开始id为{Cfg.Id}的引导,延迟{Cfg.StepStartDelay}秒开始");
|
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)); // 延迟时间开始
|
2025-04-08 14:07:20 +08:00
|
|
|
|
isWaiting = false;
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
DoRealBeforeGuide();
|
2024-05-29 16:36:30 +08:00
|
|
|
|
|
2025-04-08 16:03:25 +08:00
|
|
|
|
GuideManager.Debug($"实际执行id为{Cfg.Id}的引导");
|
2024-06-04 13:26:59 +08:00
|
|
|
|
|
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>
|
|
|
|
|
|
public void EndGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!IsGuiding)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
2024-10-11 17:17:54 +08:00
|
|
|
|
RecoverState();
|
2025-04-08 14:07:20 +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
|
|
|
|
{
|
2025-04-08 14:15:34 +08:00
|
|
|
|
UIManager.Instance.IsEnableBack = false;
|
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
|
|
|
|
}
|
|
|
|
|
|
|
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()
|
|
|
|
|
|
{
|
2024-06-04 15:13:16 +08:00
|
|
|
|
UIManager.Instance.CloseWindow(UINameConst.UI_Guide);
|
2025-04-08 14:15:34 +08:00
|
|
|
|
UIManager.Instance.IsEnableBack = true;
|
2024-06-03 19:36:47 +08:00
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置引导状态
|
|
|
|
|
|
/// </summary>
|
2025-04-08 19:05:57 +08:00
|
|
|
|
protected virtual void SetGuideState()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
{
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.Level_0); // 引导中战斗速度设为0
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 还原状态
|
|
|
|
|
|
/// </summary>
|
2025-04-08 19:05:57 +08:00
|
|
|
|
protected virtual void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.IsInBattle())
|
|
|
|
|
|
{
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.DEFAULT_SPEED); // 引导完成,战斗速度还原
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-04-08 14:07:20 +08:00
|
|
|
|
|
2025-04-08 16:03:25 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 完成引导
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void Complete()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!IsGuiding)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if (isWaiting)
|
|
|
|
|
|
{
|
|
|
|
|
|
isComplete = true;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GuideManager.Debug($"完成id为{Cfg.Id}的引导");
|
|
|
|
|
|
|
|
|
|
|
|
guideState = E_GuideState.Complete;
|
|
|
|
|
|
DoBeforeComplete();
|
|
|
|
|
|
RecoverState();
|
|
|
|
|
|
GuideManager.Instance.CompleteStep();
|
|
|
|
|
|
|
|
|
|
|
|
CommonUtils.GuideStepBiEvent(Cfg.Id, 1); // BI打点
|
|
|
|
|
|
CommonUtils.GuideStepBiEvent(Cfg.Id.ToString());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-08 14:07:20 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过条件完成引导
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="conditionResult"></param>
|
|
|
|
|
|
/// <param name="callBackParam"></param>
|
|
|
|
|
|
/// <param name="reactionID"></param>
|
|
|
|
|
|
private void OnCompleteByCondition(bool conditionResult, object callBackParam, int reactionID)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!conditionResult)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
ConditionReactor.Instance.RemoveReaction(reactionID);
|
|
|
|
|
|
Complete();
|
|
|
|
|
|
}
|
2024-05-22 19:08:14 +08:00
|
|
|
|
}
|
2025-04-08 14:07:20 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
/// 点击地板
|
2025-04-08 14:07:20 +08:00
|
|
|
|
/// </summary>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
internal sealed class ClickFloorGuide : GuideStepBase
|
2025-04-08 14:07:20 +08:00
|
|
|
|
{
|
2025-04-08 16:03:25 +08:00
|
|
|
|
public static ClickFloorGuide Create(DataGuideCfg cfg)
|
2025-04-08 14:07:20 +08:00
|
|
|
|
{
|
2025-04-08 16:03:25 +08:00
|
|
|
|
return new ClickFloorGuide(cfg);
|
2025-04-08 14:07:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
/// 底板索引
|
2025-04-08 14:07:20 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly int floorIndex;
|
|
|
|
|
|
|
2025-04-08 16:03:25 +08:00
|
|
|
|
private ClickFloorGuide(DataGuideCfg cfg) : base(cfg)
|
2025-04-08 14:07:20 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (Cfg.GuideParams.Length <= 0)
|
2025-04-08 16:03:25 +08:00
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideType},参数数量错误:1.地板索引");
|
2025-04-08 14:07:20 +08:00
|
|
|
|
|
2025-04-08 16:03:25 +08:00
|
|
|
|
if (int.TryParse(Cfg.GuideParams[0], out int index))
|
|
|
|
|
|
floorIndex = index;
|
|
|
|
|
|
else
|
2025-04-08 14:07:20 +08:00
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideType},第1个参数类型错误:应该为int类型");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override async void DoGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
|
|
|
|
|
|
|
|
|
|
|
await UI_GuideController.OpenByClickFloor(floorIndex, Cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-08 16:03:25 +08:00
|
|
|
|
protected override void DoRealBeforeGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoRealBeforeGuide();
|
|
|
|
|
|
|
|
|
|
|
|
EventManager.Instance.Register<int>(EventManager.EventName.Guide_ClickFloor, OnSetFightSpeed);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void DoBeforeComplete()
|
|
|
|
|
|
{
|
|
|
|
|
|
EventManager.Instance.Unregister<int>(EventManager.EventName.Guide_ClickFloor, OnSetFightSpeed);
|
|
|
|
|
|
|
|
|
|
|
|
base.DoBeforeComplete();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-08 14:07:20 +08:00
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
2025-04-08 19:05:57 +08:00
|
|
|
|
base.SetGuideState();
|
2025-04-08 14:07:20 +08:00
|
|
|
|
|
|
|
|
|
|
UIRoot.Instance.IsEnableGraphicRaycasterByGuide(false);
|
|
|
|
|
|
GuideManager.Instance.IsControlFloor = true;
|
|
|
|
|
|
GuideManager.Instance.FloorIndex = floorIndex;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
UIRoot.Instance.IsEnableGraphicRaycasterByGuide(true);
|
|
|
|
|
|
GuideManager.Instance.IsControlFloor = false;
|
|
|
|
|
|
GuideManager.Instance.FloorIndex = -1;
|
2025-04-08 19:05:57 +08:00
|
|
|
|
|
|
|
|
|
|
base.RecoverState();
|
2025-04-08 14:07:20 +08:00
|
|
|
|
}
|
2025-04-08 16:03:25 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 设置战斗速度
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private void OnSetFightSpeed(int cellIndex)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (cellIndex != floorIndex)
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if (LevelManager.Instance.IsInLevel &&
|
|
|
|
|
|
null != LevelManager.Instance.CurrentLevel &&
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.isInBattle)
|
|
|
|
|
|
{
|
|
|
|
|
|
//if (GuideManager.Instance.IsUseSkillSuccess)
|
|
|
|
|
|
LevelManager.Instance.CurrentLevel.SetSpeed(ELevelSpeed.DEFAULT_SPEED);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-04-08 14:07:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
/// 点击角色
|
2025-04-08 14:07:20 +08:00
|
|
|
|
/// </summary>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
internal sealed class ClickCharacterGuide : GuideStepBase
|
2025-04-08 14:07:20 +08:00
|
|
|
|
{
|
2025-04-08 16:03:25 +08:00
|
|
|
|
public static ClickCharacterGuide Create(DataGuideCfg cfg)
|
2025-04-08 14:07:20 +08:00
|
|
|
|
{
|
2025-04-08 16:03:25 +08:00
|
|
|
|
return new ClickCharacterGuide(cfg);
|
2025-04-08 14:07:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
/// 地板索引
|
2025-04-08 14:07:20 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly int floorIndex;
|
|
|
|
|
|
|
2025-04-08 16:03:25 +08:00
|
|
|
|
private ClickCharacterGuide(DataGuideCfg cfg) : base(cfg)
|
2025-04-08 14:07:20 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (Cfg.GuideParams.Length <= 0)
|
2025-04-08 16:03:25 +08:00
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideType},参数数量错误:1.角色id");
|
2025-04-08 14:07:20 +08:00
|
|
|
|
|
2025-04-08 16:03:25 +08:00
|
|
|
|
if (!int.TryParse(Cfg.GuideParams[0], out int characterId))
|
2025-04-08 14:07:20 +08:00
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideType},第1个参数类型错误:应该为int类型");
|
2025-04-08 16:03:25 +08:00
|
|
|
|
|
|
|
|
|
|
foreach (GameUnit gameUnit in GameUnitManager.instance.infightUnits.unitList)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Unit.Data.EGameUnitType.Character != gameUnit.gameunitType)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
if (gameUnit is not Character.Character characterUnit)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
if (characterId == characterUnit.ConfigId)
|
|
|
|
|
|
floorIndex = characterUnit.transData.cellIndex;
|
|
|
|
|
|
}
|
2025-04-08 14:07:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override async void DoGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
|
|
|
|
|
|
|
|
|
|
|
await UI_GuideController.OpenByClickFloor(floorIndex, Cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
2025-04-08 19:05:57 +08:00
|
|
|
|
base.SetGuideState();
|
2025-04-08 14:07:20 +08:00
|
|
|
|
|
|
|
|
|
|
UIRoot.Instance.IsEnableGraphicRaycasterByGuide(false);
|
|
|
|
|
|
GuideManager.Instance.IsControlFloor = true;
|
|
|
|
|
|
GuideManager.Instance.FloorIndex = floorIndex;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
|
|
|
|
|
UIRoot.Instance.IsEnableGraphicRaycasterByGuide(true);
|
|
|
|
|
|
GuideManager.Instance.IsControlFloor = false;
|
|
|
|
|
|
GuideManager.Instance.FloorIndex = -1;
|
2025-04-08 19:05:57 +08:00
|
|
|
|
|
|
|
|
|
|
base.RecoverState();
|
2025-04-08 14:07:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-27 13:32:18 +08:00
|
|
|
|
/// <summary>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
/// 点击敌人
|
2024-05-27 13:32:18 +08:00
|
|
|
|
/// </summary>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
internal sealed class ClickEnemyGuide : GuideStepBase
|
2024-05-27 15:39:03 +08:00
|
|
|
|
{
|
2025-04-08 16:03:25 +08:00
|
|
|
|
public static ClickEnemyGuide Create(DataGuideCfg cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new ClickEnemyGuide(cfg);
|
|
|
|
|
|
}
|
2024-10-12 12:53:47 +08:00
|
|
|
|
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// <summary>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
/// 地板索引
|
2024-05-29 16:36:30 +08:00
|
|
|
|
/// </summary>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
private readonly int floorIndex;
|
2024-05-29 16:36:30 +08:00
|
|
|
|
|
2025-04-08 16:03:25 +08:00
|
|
|
|
private ClickEnemyGuide(DataGuideCfg cfg) : base(cfg)
|
2024-05-29 16:36:30 +08:00
|
|
|
|
{
|
2025-04-08 16:03:25 +08:00
|
|
|
|
if (Cfg.GuideParams.Length <= 0)
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideType},参数数量错误:1.敌人id");
|
2024-05-27 13:32:18 +08:00
|
|
|
|
|
2025-04-08 16:03:25 +08:00
|
|
|
|
if (!int.TryParse(Cfg.GuideParams[0], out int enemyId))
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideType},第1个参数类型错误:应该为int类型");
|
|
|
|
|
|
|
|
|
|
|
|
foreach (GameUnit gameUnit in GameUnitManager.instance.infightUnits.unitList)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (enemyId == gameUnit.GetID())
|
|
|
|
|
|
floorIndex = gameUnit.transData.cellIndex;
|
|
|
|
|
|
}
|
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
|
|
|
|
|
2025-04-08 16:03:25 +08:00
|
|
|
|
await UI_GuideController.OpenByClickFloor(floorIndex, Cfg);
|
2024-10-10 13:59:48 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
{
|
|
|
|
|
|
DebugUtil.LogError($"引导id:{Cfg.Id},执行错误,异常信息:{e}");
|
|
|
|
|
|
}
|
2024-07-02 16:05:37 +08:00
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
|
|
|
|
|
protected override void SetGuideState()
|
|
|
|
|
|
{
|
2025-04-08 19:05:57 +08:00
|
|
|
|
base.SetGuideState();
|
2025-04-08 16:03:25 +08:00
|
|
|
|
|
|
|
|
|
|
UIRoot.Instance.IsEnableGraphicRaycasterByGuide(false);
|
|
|
|
|
|
GuideManager.Instance.IsControlFloor = true;
|
|
|
|
|
|
GuideManager.Instance.FloorIndex = floorIndex;
|
2024-10-08 16:13:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void RecoverState()
|
|
|
|
|
|
{
|
2025-04-08 16:03:25 +08:00
|
|
|
|
UIRoot.Instance.IsEnableGraphicRaycasterByGuide(true);
|
|
|
|
|
|
GuideManager.Instance.IsControlFloor = false;
|
|
|
|
|
|
GuideManager.Instance.FloorIndex = -1;
|
2025-04-08 19:05:57 +08:00
|
|
|
|
|
|
|
|
|
|
base.RecoverState();
|
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>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
/// 指向UI说明
|
2024-07-02 19:29:18 +08:00
|
|
|
|
/// </summary>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
internal sealed class ArrowUITipGuide : GuideStepBase
|
2024-07-02 16:05:37 +08:00
|
|
|
|
{
|
2025-04-08 16:03:25 +08:00
|
|
|
|
public static ArrowUITipGuide Create(DataGuideCfg cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new ArrowUITipGuide(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-02 16:05:37 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// UI名
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string uiName;
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按钮路径
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string buttonPath;
|
2024-10-12 12:53:47 +08:00
|
|
|
|
|
2025-04-08 16:03:25 +08:00
|
|
|
|
public ArrowUITipGuide(DataGuideCfg cfg) : base(cfg)
|
2024-07-02 16:05:37 +08:00
|
|
|
|
{
|
2025-04-08 16:03:25 +08:00
|
|
|
|
if (Cfg.GuideParams.Length > 1)
|
2024-10-10 13:59:48 +08:00
|
|
|
|
{
|
2025-04-08 16:03:25 +08:00
|
|
|
|
uiName = cfg.GuideParams[0];
|
|
|
|
|
|
buttonPath = cfg.GuideParams[1];
|
2024-10-10 13:59:48 +08:00
|
|
|
|
}
|
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
|
|
|
|
|
2025-04-08 16:03:25 +08:00
|
|
|
|
await UI_GuideController.OpenByArrowUITip(uiName, buttonPath, Cfg);
|
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-05-27 15:39:03 +08:00
|
|
|
|
}
|
2024-05-27 13:32:18 +08:00
|
|
|
|
|
2024-07-01 13:08:37 +08:00
|
|
|
|
/// <summary>
|
2025-04-08 19:05:57 +08:00
|
|
|
|
/// 点击引导按钮
|
2024-07-01 13:08:37 +08:00
|
|
|
|
/// </summary>
|
2025-04-08 19:05:57 +08:00
|
|
|
|
internal sealed class ClickButtonGuide : GuideStepBase
|
2024-07-01 13:08:37 +08:00
|
|
|
|
{
|
2025-04-08 19:05:57 +08:00
|
|
|
|
public static ClickButtonGuide Create(DataGuideCfg cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new ClickButtonGuide(cfg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-01 13:08:37 +08:00
|
|
|
|
/// <summary>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
/// UI名
|
2024-07-01 13:08:37 +08:00
|
|
|
|
/// </summary>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
private readonly string uiName;
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 按钮路径
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly string buttonPath;
|
2024-07-01 13:08:37 +08:00
|
|
|
|
|
2025-04-08 19:05:57 +08:00
|
|
|
|
public ClickButtonGuide(DataGuideCfg cfg) : base(cfg)
|
2024-07-01 13:08:37 +08:00
|
|
|
|
{
|
2025-04-08 19:05:57 +08:00
|
|
|
|
if (Cfg.GuideParams.Length < 2)
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideType},参数数量错误:1.UI名,2.按钮路径");
|
2024-07-01 13:08:37 +08:00
|
|
|
|
|
2025-04-08 19:05:57 +08:00
|
|
|
|
uiName = Cfg.GuideParams[0];
|
|
|
|
|
|
buttonPath = Cfg.GuideParams[1];
|
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
|
|
|
|
|
2025-04-08 19:05:57 +08:00
|
|
|
|
await UI_GuideController.OpenByButton(uiName, buttonPath, Cfg);
|
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
|
|
|
|
}
|
2025-04-08 19:05:57 +08:00
|
|
|
|
}
|
2024-10-08 16:13:27 +08:00
|
|
|
|
|
2025-04-08 19:05:57 +08:00
|
|
|
|
/*
|
|
|
|
|
|
#region 引导点击
|
2024-07-03 14:56:11 +08:00
|
|
|
|
|
2024-10-10 16:05:12 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
/// 滑动按钮
|
2024-10-10 16:05:12 +08:00
|
|
|
|
/// </summary>
|
2025-04-08 16:03:25 +08:00
|
|
|
|
internal sealed class SliderButtonStep : GuideStepBase
|
2024-10-10 16:05:12 +08:00
|
|
|
|
{
|
|
|
|
|
|
/// <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;
|
|
|
|
|
|
|
2025-04-08 16:03:25 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 地板索引
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly int floorIndex;
|
|
|
|
|
|
|
|
|
|
|
|
public SliderButtonStep(DataGuideCfg cfg) : base(cfg)
|
2024-10-10 16:05:12 +08:00
|
|
|
|
{
|
2025-04-08 16:03:25 +08:00
|
|
|
|
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)
|
2024-10-10 16:05:12 +08:00
|
|
|
|
{
|
2025-04-08 16:03:25 +08:00
|
|
|
|
if (int.TryParse(Cfg.GuideTypeParams[2], out int index))
|
|
|
|
|
|
floorIndex = index;
|
|
|
|
|
|
else
|
|
|
|
|
|
throw new Exception($"引导id:{Cfg.Id}, 引导类型:{Cfg.GuideStepType},第3个参数类型错误:应该为int类型");
|
2024-10-10 16:05:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override async void DoGuide()
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
base.DoGuide();
|
|
|
|
|
|
|
2025-04-08 16:03:25 +08:00
|
|
|
|
await UI_GuideController.Open(UI_GuideController.E_GuideArrowType.SliderButton, uiName, buttonPath, Cfg,
|
|
|
|
|
|
floorIndex);
|
2024-10-10 16:05:12 +08:00
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
|
|
2025-04-08 16:03:25 +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-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-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
|
|
|
|
|
2024-10-16 17:40:49 +08:00
|
|
|
|
#region 编队相关
|
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
|
2025-04-07 14:51:11 +08:00
|
|
|
|
*/
|
2024-05-22 19:08:14 +08:00
|
|
|
|
}
|