public async void Awake() { await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/chat.json", ChatConfig.getInstance().init); ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>(); ExpressionBtn = rc.Get <GameObject>("ExpressionBtn").GetComponent <Button>(); ShortBtn = rc.Get <GameObject>("ShortBtn").GetComponent <Button>(); Mask = rc.Get <GameObject>("Mask").GetComponent <Button>(); ExceptionTxt = rc.Get <GameObject>("ExceptionTxt").GetComponent <Text>(); ExpressionGrid = ExpressionBtn.transform.Find("Select_Btn/Scroll/ExpressionGrid").gameObject; ShortGrid = ShortBtn.transform.Find("Select_Btn/Scroll/ShortGrid").gameObject; ExpressionBtn.onClick.Add(() => { CreatExpressions(); }); CommonUtil.SetTextFont(this.GetParent <UI>().GameObject); Mask.onClick.Add(() => { CloseOrOpenChatUI(false); }); ShortBtn.onClick.Add(() => { CreateChatItems(); }); ExpressionItem = CommonUtil.getGameObjByBundle(UIType.UIExpression); ChatItem = CommonUtil.getGameObjByBundle(UIType.UIChatItem); isOpen = false; //选中表情包界面 CreatExpressions(); }
public async Task getAllData() { UINetLoadingComponent.showNetLoading(); try { await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/tips.json", TipsConfig.getInstance().init); await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/prop.json", PropConfig.getInstance().init); await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/zhuanpan.json", ZhuanPanConfig.getInstance().init); await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/notice.json", NoticeConfig.getInstance().init); await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/friendRoomConfig.json", FriendRoomConfig.getInstance().init); //await SensitiveWordUtil.Req("http://fwdown.hy51v.com/online/file/stopwords.txt"); string data = CommonUtil.getTextFileByBundle("config", "stopwords"); SensitiveWordUtil.WordsDatas = data.Split(','); } catch (Exception ex) { Log.Error(ex); } UINetLoadingComponent.closeNetLoading(); }
public async void Awake() { // 获取配置文件 { string fileName = "otherConfig-" + PlatformHelper.GetVersionName() + ".json"; await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/" + fileName, OtherConfig.getInstance().init); } ToastScript.clear(); Instance = this; initData(); CommonUtil.SetTextFont(panel_start.transform.parent.gameObject); }
public async void Start() { try { await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/activity.json", ActivityConfig.getInstance().init); ReferenceCollector rc = GetParent <UI>().GameObject.GetComponent <ReferenceCollector>(); returnBtn = rc.Get <GameObject>("ReturnBtn").GetComponent <Button>(); ActivityGrid = rc.Get <GameObject>("ActivityGrid"); NoticeBtn = rc.Get <GameObject>("NoticeBtn").GetComponent <Button>(); ActivityBtn = rc.Get <GameObject>("ActivityBtn").GetComponent <Button>(); Panel = rc.Get <GameObject>("Panel"); Activity = rc.Get <GameObject>("Activity"); Notice = rc.Get <GameObject>("Notice"); noticeItem = CommonUtil.getGameObjByBundle(UIType.UINoticeItem); activityItem = CommonUtil.getGameObjByBundle(UIType.UIActivityItem); Grid = rc.Get <GameObject>("Grid"); CommonUtil.SetTextFont(this.GetParent <UI>().GameObject); GetActivityItemList(); //返回 returnBtn.onClick.Add(() => { Game.Scene.GetComponent <UIComponent>().Remove(UIType.UIActivity); }); //点击显示通知栏 NoticeBtn.onClick.Add(() => { NoticeBtn.transform.GetChild(0).gameObject.SetActive(true); ActivityBtn.transform.GetChild(0).gameObject.SetActive(false); Notice.SetActive(true); Activity.SetActive(false); CreateNoticeItems(); }); //点击显示活动栏 ActivityBtn.onClick.Add(() => { GetActivityItemList(); }); } catch (Exception e) { Log.Error(e); } }