using Gameplay.HeroSelect; using Gameplay.Naming; using Gameplay.Net; using PhxhSDK; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Gameplay.FirstTimeFlow { /// /// 新号强制流程管理器 /// public sealed class FirstTimeFlowManager : Singlenton, IInitable { /// /// 强制流程步骤链表 /// private LinkedList linkStep; /// /// 当前步骤 /// public FirstTimeFlowStep CurStep { get; private set; } /// /// 是否强制流程中 /// public bool IsFlowing { get { return null != CurStep; } } /// /// 是否在剧情中需要设置角色 /// /// public bool IsNeedSetHeroByStory { get { return CurStep is EnterStoryLevel1Step; }// && !HeroSelectManager.Instance.IsSetHero; } } /// /// 是否需要在剧情中设置名字 /// public bool IsNeedSetNameByStory { get { return CurStep is EnterStoryLevel2Step; }// && !NamingManager.Instance.IsSetName; } } public void Init() { linkStep = new LinkedList(); } public void Release() { } /// /// 开始强制流程 /// /// 是否强制流程 public bool StartFirstTimeFlow() { int severFlowId = (int)Actor.Instance.Logic.GetCount((uint)NLDPB.LogicID.NoviceProcessId); // 服务器所在强制流程步骤id if (severFlowId < (int)E_FirstTimeFlow.StarVideo) linkStep.AddLast(PlayStartVideoStep.Create()); // 开始PV if (severFlowId < (int)E_FirstTimeFlow.StoryLevel_1) linkStep.AddLast(EnterStoryLevel1Step.Create()); // 剧情1 if (severFlowId < (int)E_FirstTimeFlow.FightLevel_1) linkStep.AddLast(EnterFightLevel1Step.Create()); // 特殊战斗1 if (severFlowId < (int)E_FirstTimeFlow.StoryLevel_2) linkStep.AddLast(EnterStoryLevel2Step.Create()); // 剧情2 if (severFlowId < (int)E_FirstTimeFlow.FightLevel_2_EditTeam) linkStep.AddLast(FightLevel2EditTeamStep.Create()); // 特殊战斗2编队 if (severFlowId < (int)E_FirstTimeFlow.StoryLevel_3) linkStep.AddLast(EnterStoryLevel3Step.Create()); // 剧情3 if (severFlowId < (int)E_FirstTimeFlow.EndVideo) linkStep.AddLast(PlayEndVideoStep.Create()); // 结束PV if (linkStep.Count > 0) { StartNextStep(); return true; } return false; } /// /// 开始下一个步骤 /// public void StartNextStep() { if (linkStep.Count <= 0) { CurStep = null; return; } CurStep = linkStep.First.Value; linkStep.RemoveFirst(); CurStep.Run(); //NetHelper.SaveGuideProgress(NLDPB.LogicID.NoviceProcessId, (int)step.FirstTimeFlow); } } }