using System.Collections.Generic; using MoleMole.Config; using UnityEngine; using UnityEngine.UI; using proto; namespace MoleMole { public class LevelPreparePageContext : BasePageContext { private const int MAX_TEAM_MEMBER_NUM = 3; public readonly LevelDataItem level; private List _showDataList; private FriendBriefDataItem _selectedHelper; private int _playerUidToShow; private bool _isWaitingLevelBegin; private StageBeginRsp _stageBeginRsp; private FriendDetailDataItem _helperDetailData; private LoadingWheelWidgetContext _loadingWheelDialogContext; public LevelPreparePageContext(LevelDataItem level) { config = new ContextPattern { contextName = "LevelPreparePageContext", viewPrefabPath = "UI/Menus/Page/Map/LevelPreparePage", cacheType = ViewCacheType.AlwaysCached }; this.level = level; _playerUidToShow = -1; _isWaitingLevelBegin = false; _showDataList = new List(); } public override bool OnPacket(NetPacketV1 pkt) { switch (pkt.getCmdId()) { case 44: return OnStageBeginRsp(pkt.getData()); case 73: return OnPlayerDetailRsp(pkt.getData()); default: return false; } } public override bool OnNotify(Notify ntf) { if (ntf.type == NotifyTypes.TeamMemberChanged) { SetupMyTeam(); SetupLeaderSkill(); return false; } if (ntf.type == NotifyTypes.ShowStaminaExchangeInfo2) { return ShowStaminaExchangeDialog(); } return false; } public bool ShowStaminaExchangeDialog() { Singleton.Instance.ShowDialog(new StaminaExchangeDialogContext("Menu_Desc_StaminaExchange2")); return false; } protected override void BindViewCallbacks() { BindViewCallback(base.view.transform.Find("Btn").GetComponent