Example #1
0
        public override async void Dispose()
        {
            base.Dispose();
            for (int i = 0; i < emailList.Count; ++i)
            {
                //设置当前未读文本邮件为已读
                if (string.IsNullOrEmpty(emailList[i].RewardItem))
                {
                    G2C_EmailOperate g2cGetItem = (G2C_EmailOperate)await SessionComponent.Instance
                                                  .Session.Call(new C2G_EmailOperate
                    {
                        Uid     = PlayerInfoComponent.Instance.uid,
                        EmailId = emailList[i].EId,
                        state   = 1
                    });
                }
            }

            notGetcount = 0;

            emailItemList.Clear();
            uiList.Clear();
            emailList.Clear();
            Instance = null;

            // using (UnityWebRequestAsync webRequestAsync = ETModel.ComponentFactory.Create<UnityWebRequestAsync>())
            // {
            //     string versionUrl = GlobalConfigComponent.Instance.GlobalProto.GetUrl() + "StreamingAssets/" + "Version.txt";
            //     //Log.Debug(versionUrl);
            //     await webRequestAsync.DownloadAsync(versionUrl);
            //
            //     string test = webRequestAsync.Request.downloadHandler.text;
            //     //Log.Debug(JsonHelper.ToJson(this.VersionConfig));
            // }
        }
Example #2
0
        public void Awake()
        {
            Instance = this;
            ReferenceCollector rc = GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            returnBtn     = rc.Get <GameObject>("ReturnBtn").GetComponent <Button>();
            grid          = rc.Get <GameObject>("Grid");
            emailCountTxt = rc.Get <GameObject>("EmailCountTxt").GetComponent <Text>();
            NoEmailTip    = rc.Get <GameObject>("NoEmailTip").GetComponent <Text>();

            CommonUtil.SetTextFont(this.GetParent <UI>().GameObject);

            returnBtn.onClick.Add(() =>
            {
                Game.Scene.GetComponent <UIComponent>().Remove(UIType.UIEmail);
            });

            emailItem = CommonUtil.getGameObjByBundle(UIType.UIEmailItem);

            GetEmail();
        }