using System; using System.Collections; using MoleMole.Config; using UniRx; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; using proto; namespace MoleMole { public class GameEntryPageContext : BasePageContext { public enum DescImageType { None = 0, Loading = 1, Identifying = 2, Confirmed = 3 } private Coroutine _splashFadeOutCoroutine; private int _splashFadeOutFrameCount = 30; private int _transitBlackFadeOutFrameCount = 60; private int _transitBlackVideoFadeOutFrameCount = 15; private bool _hasLogin; private LoadingWheelWidgetContext _loadingWheelDialogContext; private bool _agreementShowed; public bool _accountReady; public bool IsSplashFadeOut { get; private set; } public GameEntryPageContext(GameObject view) { config = new ContextPattern { contextName = "GameEntryContext" }; showSpaceShip = true; base.view = view; } public override bool OnPacket(NetPacketV1 pkt) { switch (pkt.getCmdId()) { case 25: case 48: return OnGetAvatarReletedInfo(); case 5: return OnGetPlayerTokenRsp(pkt.getData()); case 7: return OnPlayerLoginRsp(pkt.getData()); case 44: return OnStageBeginRsp(pkt.getData()); default: return false; } } public override bool OnNotify(Notify ntf) { if (ntf.type == NotifyTypes.ShowMihoyoLoginUI) { return ShowMihoyoLoginUI(); } if (ntf.type == NotifyTypes.MihoyoAccountLoginSuccess) { return OnMihoyoAccountLoginSuccess(); } if (ntf.type == NotifyTypes.ShowLoadAssetText) { return ShowLoadAssetText((bool)ntf.body); } if (ntf.type == NotifyTypes.SetLoadAssetText) { return SetLoadAssetText((Tuple)ntf.body); } if (ntf.type == NotifyTypes.FadeOutGameEntrySplash) { return FadeOutSplash(); } if (ntf.type == NotifyTypes.SDKAccountLoginSuccess) { return OnSDKAccountLoginSuccess(); } if (ntf.type == NotifyTypes.ShowVersionText) { return OnShowVersionText(); } return false; } protected override void BindViewCallbacks() { BindViewCallback(base.view.transform.Find("DebugBtn").GetComponent