public void init() { _Btn0.onClick.AddListener(() => { GameResources.Instance()._GameMgr._AIPlayer.onitemclick(_Target); TTUIPage.ClosePage <UIItemPage>(); }); _Btn1.onClick.AddListener(() => { TTUIPage.ClosePage <UIItemPage>(); }); _Btn2.onClick.AddListener(() => { TTUIPage.ClosePage <UIItemPage>(); }); }
public void RemovePropFromList(PropBaseModel _model) { if (!playerData.RemoveListProp(_model)) { return; } if (playerData.dic_listProp.Count <= 0) { TTUIPage.ClosePage <aSong_UIPropList>(); } else { RefreshPropList(); } }
/// <summary> /// 是否显示提示按钮 /// </summary> /// <param name="isshow">按钮是否显示</param> /// <param name="_itemList">NPC传来的物品列表</param> public void ShowTishi(bool isshow, List <int> _itemList) { //tempShopList = _itemList; buttonTishi.gameObject.SetActive(isshow);//默认隐藏提示按钮 if (isshow) { buttonTishi.onClick.AddListener(() => TTUIPage.ShowPage <ShopPanel>(_itemList)); } if (!isshow) { if (TTUIPage.allPages.ContainsKey("ShopPanel")) { TTUIPage.ClosePage <ShopPanel>(); } buttonTishi.onClick.RemoveAllListeners(); } }
public override void Awake(GameObject go) { base.Awake(go); //找到各个按钮 buttonStatus = transform.Find("ButtonStatus").GetComponent <Button>(); buttonEquip = transform.Find("ButtonEquip").GetComponent <Button>(); buttonBag = transform.Find("ButtonBag").GetComponent <Button>(); buttonSkill = transform.Find("ButtonSkill").GetComponent <Button>(); buttonTishi = transform.Find("ButtonTishi").GetComponent <Button>(); buttonTask = transform.Find("ButtonTask").GetComponent <Button>(); buttonTishi.gameObject.SetActive(false); //默认隐藏提示按钮 ShopItemlist.OnNPCTrigger += ShowTishi; //提示按钮在人物接近商店NPC时出现,远离时隐藏 TaskList.OnNPCTrigger += ShowTishi; //buttonTishi.onClick.AddListener(() => TTUIPage.ShowPage<ShopPanel>(tempShopList)); buttonBag.onClick.AddListener(() => TTUIPage.ShowPage <BagPanel>()); buttonEquip.onClick.AddListener(() => TTUIPage.ShowPage <EquipPanel>()); buttonTask.onClick.AddListener(() => TTUIPage.ShowPage <TaskPanel>()); //先加载TaskPanel的资源,防止TaskPanel里的事件不能及时绑定 TTUIPage.ShowPage <TaskPanel>(); TTUIPage.ClosePage <TaskPanel>(); }
public void DownloadSave(string json) { Dictionary <string, string> pathmap = JsonHelper.ParseDownloadPath(json, Tool.downloadbodykey, Tool.Protectiveclothingkey); if (pathmap == null || pathmap.Count == 0) { return; } //TODO--->>> 根据返回路径下载对应模型存储到本地返回给modelmanager string bodyurl = pathmap[Tool.downloadbodykey]; string Protectiveclothingurl = pathmap[Tool.Protectiveclothingkey]; //两个路径 string bodyurlsavefilename = PlayerDataCenter.Currentillnessdata.ID + Tool.downloadbodykey + ".stl"; string Protectiveclothingfilename = PlayerDataCenter.Currentillnessdata.ID + Tool.Protectiveclothingkey + ".stl"; MyWebRequest.Instance.DownloadFileFromWed(bodyurl, Tool.SaveDownLoadFromWebPath, bodyurlsavefilename, (success, str) => { TTUIPage.ShowPage <UINotice>(Tool.DownloadDir); if (success) { TTUIPage.ClosePage <UINotice>(); //存在本地的模型路径 string _messagestr = MSGCenter.FormatMessage(Tool.downloadbodykey, Tool.SaveDownLoadFromWebPath + bodyurlsavefilename); MSGCenter.Execute(Enums.MainProcess.MainProcess_SaveALL.ToString(), _messagestr); } }); MyWebRequest.Instance.DownloadFileFromWed(Protectiveclothingurl, Tool.SaveDownLoadFromWebPath, Protectiveclothingfilename, (success, str) => { if (success) { //存在本地的模型路径 string _messagestr = MSGCenter.FormatMessage(Tool.Protectiveclothingkey, Tool.SaveDownLoadFromWebPath + Protectiveclothingfilename); MSGCenter.Execute(Enums.MainProcess.MainProcess_SaveALL.ToString(), _messagestr); } }); }
public void SaveAll() { //如果匹配没有完成,提醒用户,不能上传 List <int> notcheckinglist = CheckAllMatchDone(); if (notcheckinglist.Count > 0) { StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < notcheckinglist.Count; i++) { stringBuilder.Append(" " + Tool.NumberToChar(notcheckinglist[i] + 1) + " "); } string _strs = MSGCenter.FormatMessage("第<color=red>" + stringBuilder.ToString() + "</color>组未匹配", "3"); TTUIPage.ShowPage <UINotice>(_strs); return; } int currentillnessdataid = PlayerDataCenter.Currentillnessdata.ID; string url = Tool.refreshillnessdatasimplepath + currentillnessdataid; MyWebRequest.Instance.Get(Tool.requestdetailillnessdatapath + currentillnessdataid, (success, str) => { bool hasvalue = false; if (success) { hasvalue = JsonHelper.ChackMatchingHasValue(str); string _url = ""; string _message = ""; if (hasvalue) { int pointid = JsonHelper.GetPointID(str); //更新旧的 _url = Tool.refreshmathcingpointpath + pointid; _message = JsonHelper.MergMatchingpointChangeNeed(PlayerDataCenter.Currentillnessdata); MyWebRequest.Instance.Put(_url, _message, (suc, ss) => { TTUIPage.ShowPage <UINotice>(Tool.DownloadDir + ss); if (suc) { //解析路径 string downloadurlsjson = JsonHelper.ParseJsonToNeed(str, Tool.datakey, Tool.PieceProtectorURLkey); DownloadSave(downloadurlsjson); TTUIPage.ClosePage <UINotice>(); } }); } else { //添加新的 _url = Tool.addmatchingpointspath; MyWebRequest.Instance.Post(_url, JsonHelper.MergMatchingpointChangeNeed(PlayerDataCenter.Currentillnessdata), (_suc, _str) => { TTUIPage.ShowPage <UINotice>(Tool.DownloadDir + _str); if (_suc) { //解析路径 string downloadurlsjson = JsonHelper.ParseJsonToNeed(str, str, Tool.datakey, Tool.PieceProtectorURLkey); DownloadSave(downloadurlsjson); TTUIPage.ClosePage <UINotice>(); } }); } } }); }
public override void Awake(GameObject go) { base.Awake(go); okButton = GameObject.Find("Buttonok").GetComponent <Button>(); okButton.onClick.AddListener(() => { TTUIPage.ClosePage <TipePanel>(); }); }