using System.Collections.Generic; using MoleMole.Config; using UnityEngine; using UnityEngine.UI; using proto; namespace MoleMole { public class EndlessPreparePageContext : BasePageContext { private const int MAX_TEAM_MEMBER_NUM = 3; private EndlessStageBeginRsp _stageBeginRsp; private EndlessGroupMetaData _groupMetaData; private LoadingWheelWidgetContext _loadingWheelDialogContext; private bool _enterBattleDirrectly; public EndlessPreparePageContext(bool enterBattleDirrectly = false) { config = new ContextPattern { contextName = "EndlessPreparePageContext", viewPrefabPath = "UI/Menus/Page/EndlessActivity/EndlessPreparePage" }; _enterBattleDirrectly = enterBattleDirrectly; } public override bool OnPacket(NetPacketV1 pkt) { switch (pkt.getCmdId()) { case 142: return OnStageBeginRsp(pkt.getData()); case 150: return OnGetEndlessAvatarHpRsp(pkt.getData()); default: return false; } } public override bool OnNotify(Notify ntf) { if (ntf.type == NotifyTypes.TeamMemberChanged) { SetupMyTeam(); SetupLeaderSkill(); SetupFightBtnInterable(); } if (ntf.type == NotifyTypes.EndlessActivityEnd || ntf.type == NotifyTypes.EndlessActivitySettlement || ntf.type == NotifyTypes.EndlessActivityBegin) { Singleton.Instance.BackPage(); } if (ntf.type == NotifyTypes.EndlessAppliedToolChange) { return SetupInfoPanel(); } return false; } protected override void BindViewCallbacks() { BindViewCallback(base.view.transform.Find("Action/Btn").GetComponent