public static void OnRegister(this UILoginView self) { Game.EventSystem.PublishAsync(new UIEventType.ShowToast() { Text = "测试OnRegister" }).Coroutine(); RedDotComponent.Instance.RefreshRedDotViewCount("Test1", 1); }
public static void OnLogin(this UILoginView self) { self.loginBtn.SetInteractable(false); GlobalComponent.Instance.Account = self.account.GetText(); PlayerPrefs.SetString(CacheKeys.Account, self.account.GetText()); PlayerPrefs.SetString(CacheKeys.Password, self.password.GetText()); LoginHelper.Login(self.scene, self.ipaddr.GetText(), self.account.GetText(), self.password.GetText(), () => { self.loginBtn.SetInteractable(true); }).Coroutine(); }
public static LoopListViewItem2 GetItemByIndex(this UILoginView self, LoopListView2 listView, int index) { if (index < 0 || index >= ServerConfigCategory.Instance.GetAll().Count) { return(null); } var data = ServerConfigCategory.Instance.Get(index + 1); //配置表从1开始的 var item = listView.NewListViewItem("SettingItem"); if (!item.IsInitHandlerCalled) { item.IsInitHandlerCalled = true; self.settingView.AddItemViewComponent <UISettingItem>(item); } var uiitemview = self.settingView.GetUIItemView <UISettingItem>(item); uiitemview.SetData(data, (id) => { self.OnBtnClick(id); }); return(item); }
public static void OnBtnClick(this UILoginView self, int id) { self.ipaddr.SetText(ServerConfigComponent.Instance.ChangeEnv(id).RealmIp); }