public void ImportToResPanel() { TypeEventSystem.Send(new ClearRescoursePanel()); var dict = getResConfig(DirTools.GetRestoredPNGDir()); foreach (KeyValuePair <string, Dictionary <string, string> > kv in dict) { var properties = kv.Value; var Name = properties["Name"]; var MD5 = properties["MD5"]; var Extension = properties["Extension"]; var fileinfo = new FilePathInfo() { FilePath = DirTools.GetRestoredPNGDir() + "/" + MD5 + Extension, FileName = Name + Extension, Extension = Extension, MD5 = MD5 }; TypeEventSystem.Send(fileinfo); TypeEventSystem.Send(new SetBlockProperties() { MD5 = MD5, properties = properties }); } UIMgr.ClosePanel("UIUploadPanel"); }
protected override void RegisterUIEvent() { BtnContinue.OnClickAsObservable().Subscribe(_ => { //UIMgr.GetPanel<UIGamePanel>().mData.ShowCharacters = true; UIMgr.GetPanel <UIGamePanel>().Transform.Find("Characters").gameObject.SetActive(true); UIMgr.GetPanel <UIGamePanel>().Transform.Find("Emenys").gameObject.SetActive(true); CloseSelf(); }); BtnRestart.OnClickAsObservable().Subscribe(_ => { //UIMgr.GetPanel<UIGamePanel>().mData.ShowCharacters = true; UIMgr.GetPanel <UIGamePanel>().Transform.Find("Characters").gameObject.SetActive(true); UIMgr.GetPanel <UIGamePanel>().Transform.Find("Emenys").gameObject.SetActive(true); CloseSelf(); }); BtnGiveUp.OnClickAsObservable().Subscribe(_ => { CloseSelf(); UIMgr.ClosePanel <UIGamePanel>(); }); BtnSetting.OnClickAsObservable().Subscribe(_ => { UIMgr.OpenPanel <UIGamePauseSettingPanel>(); }); }
protected override void OnInit(QFramework.IUIData uiData) { mData = uiData as UIUploadPanelData ?? new UIUploadPanelData(); // please add init code here ActivityIndex = mData.ActivityIndex.ToLower(); Query.onClick.AddListener(() => { var lst = new List <Transform>(); foreach (Transform child in Content) { lst.Add(child); } for (int i = 0; i < lst.Count; i++) { Destroy(lst[i].gameObject); } var str = ItemIdDropdown.GetComponent <Dropdown>().captionText.text; if (str.IndexOf("SkinName") > -1) { ItemId = str.Split('|')[1].Split(':')[1]; StartCoroutine(GetAttachments("Skin", ItemId)); } }); Home.onClick.AddListener(() => { UIMgr.ClosePanel("UIUploadPanel"); }); Auth = PlayerPrefs.GetString("access_token"); StartCoroutine(GetItemId(int.Parse(mData.id))); ActivityText.text = ActivityIndex; }
IEnumerator TestAuth(string auth) { var url = string.Format("https://gate.mongomath.com:8443/admin-course/courses"); UnityWebRequest webRequest = UnityWebRequest.Get(url); webRequest.SetRequestHeader("Authorization", auth); webRequest.SetRequestHeader("Content-Type", "application/json"); yield return(webRequest.SendWebRequest()); if (webRequest.isNetworkError) { Debug.Log(": Error: " + webRequest.error); } else { Debug.Log("kecheng" + webRequest.downloadHandler.text); var res = webRequest.downloadHandler.text; if (res.IndexOf("·Ç·¨·ÃÎÊ") > -1) { } else { UIMgr.OpenPanel("UIActivityPanel", UILevel.Common); UIMgr.ClosePanel("UILoginPanel"); } } }
public void OnMMEvent(CorgiEngineEvent eventType) { if (eventType.EventType == CorgiEngineEventTypes.PlayerDeath) { mData.DeathCount++; // 更新UI TxtDeathCount.text = string.Format("Death Count : {0}", mData.DeathCount); // 播放死亡的声音 this.SendMsg(new AudioSoundMsg(QAssetBundle.Sounds.HIT)); } else if (eventType.EventType == CorgiEngineEventTypes.Pause) { var pausePanel = UIMgr.GetPanel <UIGamePausePanel>(); if (pausePanel) { UIMgr.ClosePanel <UIGamePausePanel>(); } else { UIMgr.OpenPanel <UIGamePausePanel>(UILevel.PopUI); } } else if (eventType.EventType == CorgiEngineEventTypes.UnPause) { UIMgr.ClosePanel <UIGamePausePanel>(); } }
protected override void RegisterUIEvent() { mSaveBtn.AddCallback(new UnityEngine.Events.UnityAction(() => { mSetSqlite.UpdateTable(mInputSettings, "Type"); if (GlobalManager.Instance.Character != null) { if (GlobalManager.Instance.Character.GetComponent <CharacterFSM>() != null) { GlobalManager.Instance.Character.GetComponent <CharacterFSM>().ReloadInputKey(); } } })); mCancelBtn.AddCallback(new UnityEngine.Events.UnityAction(() => { mInputSettings = mSetSqlite.SelectTable <InputSetting>(); _InitItems(); })); mReturnBtn.AddCallback(new UnityEngine.Events.UnityAction(() => { UIMgr.ClosePanel <InputSetList>(); })); }
void Start() { ResMgr.Init(); UIMgr.OpenPanel <UIConnect>(UILevel.PopUI); QEventSystem.RegisterEvent(101, (x, y) => { UIMgr.ClosePanel <UIConnect>(); UIMgr.OpenPanel <UIMsg>(); }); }
public void onValueChanged(bool open) { if (open) { UIMgr.ClosePanel("UIPropertiesPanel"); UIMgr.OpenPanel("UIPropertiesPanel", UILevel.Common, new UIPropertiesPanelData() { Properties = this.Properties }); } }
/** * 统一打开首页,关闭其他panel */ public static void OpenCloudMain(UIPanel selfBehaviour, IUIData uiData = null) { UIMgr.OpenPanel <MainPanel>(uiData, UITransitionType.CLOUD, null, null, null, delegate { if (selfBehaviour != null) { UIMgr.CloseAllOtherPanel(MainPanel.NAME); UIMgr.ClosePanel(selfBehaviour.name); } }); }
protected override void OnInit(QFramework.IUIData uiData) { mData = uiData as UIPropertiesPanelData ?? new UIPropertiesPanelData(); // please add init code here Item.gameObject.SetActive(false); Properties = mData.Properties; SetProperties(mData.Properties); btnClose.onClick.AddListener(() => { UIMgr.ClosePanel("UIPropertiesPanel"); }); }
/// <summary> /// 个人信息界面的点击事件集 /// 1.点击个人信息进入个人信息界面(暂定) /// 2.飞行练习点击事件,进入其他场景 /// </summary> protected override void RegisterUIEvent() { SelfInfo.onClick.AddListener(() => { UIMgr.OpenPanel <UIInfoPanel>(); UIMgr.ClosePanel <UIPlayerMainMenu>(); }); FlyPractice.onClick.AddListener((() => { SceneManager.LoadScene("Game"); })); }
/// <summary> /// UI赋值事件 /// </summary> /// <param name="_data">绑定的数据</param> void AssigneEvents(PlayerData _data) { Text titlename = transform.Find("Text").GetComponent <Text>(); titlename.text = _data.title; //点击显示/隐藏 transform.Find("Toggle").GetComponent <Toggle>().onValueChanged.AddListener(iSon => { titlename.text = iSon ? _data.title : "***"; }); //点击编辑 transform.Find("Button").GetComponent <Button>().onClick.RemoveAllListeners(); transform.Find("Button").GetComponent <Button>().onClick.AddListener(() => { UICreateIllnessPopupData _d = new UICreateIllnessPopupData(); _d.playerdata = selfplayerdata; UIMgr.OpenPanel <UICreateIllnessPopup>(canvasLevel: UILevel.PopUI, prefabName: "Resources/UICreateIllnessPopup", uiData: _d); QUIManager.Instance.HideUI <UIFirstPage>(); }); //点击病例 GetComponent <Button>().onClick.RemoveAllListeners(); GetComponent <Button>().onClick.AddListener(() => { //TODO ---->>>>> NextScene //当前选择用户 并 赋值好normalpoints 及 userpoints PlayerDataCenter.Instance.Currentplayerdata = selfplayerdata; UIPanelData paneldata = new UIThirdPageData() { pdata = selfplayerdata }; UIMgr.ClosePanel("Resources/UIFirstPage"); UIMgr.OpenPanel <UIThirdPage>(prefabName: "Resources/UIThirdPage", uiData: paneldata); //* ①将所有信息都存储到本地(ID).json (MD5,MatchingPoint,PlayerSetting) //* ②成功后回调 //* ③根据Md5加载normalmodel和usermodel(也可能是下载得来) //* ④成功回调设置摄像机旋转中心 //* ⑤打开第二界面 //* ⑥刷新UI列表 //* ⑦设置默认界面 //打开第二界面 }); }
protected override void RegisterUIEvent() { MusicSlider.onValueChanged.AddListener((volume) => { AudioManager.Instance.SetBGMVolume(volume); }); AudioSlider.onValueChanged.AddListener((volume) => { AudioManager.Instance.SetEffectVolume(volume); }); ButtonReturn.AddCallback(() => { UIMgr.ClosePanel <AudioSettingPanel>(); }); }
protected override void RegisterUIEvent() { BtnClose.OnClickAsObservable().Subscribe(_ => { CloseSelf(); }); Background.OnClickAsObservable().Subscribe(_ => { CloseSelf(); }); BtnStart.OnClickAsObservable().Subscribe(_ => { CloseSelf(); UIMgr.ClosePanel <UIMapStagesPanel>(); UIMgr.OpenPanel <UIGamePanel>(); }); }
protected override void RegisterUIEvent() { //登陆按键触发事件,暂时定为点击登陆就跳转主界面,同时关闭登陆的按钮 //检查账号是否存在(否则就提醒新建账号) //账号密码是否正确(否则就提醒玩玩家重新输入账号) Btn_Login.onClick.AddListener(() => { UIMgr.OpenPanel <UIPlayerMainMenu>(); UIMgr.ClosePanel <UILoginPanel>(); }); //注册案件点击事件,点击跳转注册界面 Btn_Registe.onClick.AddListener((() => { UIMgr.OpenPanel <UIRegistePanel>(); UIMgr.ClosePanel <UILoginPanel>(); })); }
private void Awake() { ShowValueChaged(); BtnClose.OnClickAsObservable().Subscribe(_ => { // 关闭父节点的panel UIMgr.ClosePanel(transform.parent.name); }); BtnGemAdd.OnClickAsObservable().Subscribe(_ => { UIMgr.OpenPanel <UIShopGemPanel>(); }); BtnGoldAdd.OnClickAsObservable().Subscribe(_ => { UIMgr.OpenPanel <UIShopGoldPanel>(); }); }
private void StartClick() { var text = ActivityOptions.GetComponent <Dropdown>().captionText.text; if (text.IndexOf("-") > -1) { var id = text.Split(':')[1]; var index = text.Split(' ')[0]; int tmp = 0; if (int.TryParse(id, out tmp)) { UIMgr.OpenPanel("UIResourcePanel", UILevel.Common, new UIResourcePanelData() { activityIndex = index, id = id }); UIMgr.ClosePanel("UIActivityPanel"); } } }
protected override void RegisterUIEvent() { ButtonBackHome.transform.Find("Container/Background").GetComponent <MMTouchButton>() .ButtonPressedFirstTime .AddListener(() => { SendMsg(new AudioSoundMsg("click")); UIMgr.ClosePanel <UIGamePanel>(); CloseSelf(); }); ButtonResume.transform.Find("Container/Background").GetComponent <MMTouchButton>() .ButtonPressedFirstTime .AddListener(() => { SendMsg(new AudioSoundMsg("click")); }); ButtonRestart.transform.Find("Container/Background").GetComponent <MMTouchButton>() .ButtonPressedFirstTime .AddListener(() => { SendMsg(new AudioSoundMsg("click")); }); }
public static void LevelFinish() { if (Mode == GameMode.ModeNormal) { string nextLevelName = LevelConfig.GetNextLevelName(); if (LevelManager.Instance != null) { LevelManager.Instance.GotoLevel(nextLevelName); } else { LoadingSceneManager.LoadScene(nextLevelName); } } else { SceneManager.LoadScene("Empty"); UIMgr.ClosePanel <UIGamePanel>(); UIMgr.OpenPanel <UITrainModePanel>(); } }
IEnumerator LoginClick() { var mobile = Mobile.text; var google = Google.text; var passwd = Passwd.text; WWWForm form = new WWWForm(); form.AddField("mobile", mobile); form.AddField("nonce", google); form.AddField("password", passwd); var webRequest = UnityWebRequest.Post("https://gate.mongomath.com:8443/a/user/login", form); //webRequest.SetRequestHeader("Content-Type", "application/json"); yield return(webRequest.SendWebRequest()); if (webRequest.isNetworkError) { Debug.Log(": Error: " + webRequest.error); } else { Debug.Log(webRequest.downloadHandler.text); var token = QF.SerializeHelper.FromJson <AccessToken>(webRequest.downloadHandler.text); if (token.access_token != null) { PlayerPrefs.SetString("access_token", "Bearer " + token.access_token); UIMgr.OpenPanel("UIActivityPanel", UILevel.Common); UIMgr.ClosePanel("UILoginPanel"); } else { MessageBoxV2.AddMessage(webRequest.downloadHandler.text); } } }
protected override void RegisterUIEvent() { Button_Resume.AddCallback(() => { GlobalManager.Instance.isPaused = false; Time.timeScale = 1; UIMgr.ClosePanel <SettingPanel>(); }); Button_InputSet.AddCallback(() => { UIMgr.OpenPanel <InputSetList>(); }); Button_MainMenu.AddCallback(() => { GlobalManager.Instance.HideMainScene(); }); Button_AudioSet.AddCallback(() => { UIMgr.OpenPanel <AudioSettingPanel>(); }); }