using System.Collections; using System.Collections.Generic; using MoleMole.Config; using UnityEngine; using UnityEngine.UI; using proto; namespace MoleMole { public class AvatarOverviewPageContext : BasePageContext { public enum PageType { Show = 0, TeamEdit = 1, GalTouchReplace = 2 } private const string STIGMATA_ICON_EMPTY_PATH = "SpriteOutput/StigmataSmallIcon/Icon_add"; private List showAvatarList; public PageType type; public int selectedAvatarID; public bool showAvatarRemainHP; public StageType levelType; public int teamEditIndex; public VentureDataItem ventureData; public AvatarOverviewPageContext() { config = new ContextPattern { contextName = "AvatarOverviewPageContext", viewPrefabPath = "UI/Menus/Page/AvatarOverviewPage", cacheType = ViewCacheType.AlwaysCached }; showSpaceShip = true; } public override bool OnPacket(NetPacketV1 pkt) { switch (pkt.getCmdId()) { case 25: return SetupView(); case 30: return OnAvatarStarUpRsp(pkt.getData()); default: return false; } } public override bool OnNotify(Notify ntf) { if (ntf.type == NotifyTypes.SelectAvtarIconChange) { return UpdateSelectedAvatar((int)ntf.body); } if (ntf.type == NotifyTypes.UnlockAvatar) { int avatarID = (int)ntf.body; Singleton.Instance.ShowDialog(new AvatarUnlockDialogContext(avatarID)); } return false; } protected override void BindViewCallbacks() { BindViewCallback(base.view.transform.Find("3dPanel").GetComponent