摘要: 写入txt不需要打开这个提醒他文件,写完记得关闭写入流。 void NoteReStart() { restartCnt++; StreamWriter sw = new StreamWriter(txt_path); sw.WriteLine("重启次数:" + restartCnt.ToStri 阅读全文
posted @ 2020-09-28 10:49 werky 阅读(2436) 评论(0) 推荐(0) 编辑
摘要: 代码如下: void Update() { if (clientScene.msgCount > preMsgCount) //长时间没有得到进程的反馈 { preMsgCount = clientScene.msgCount; recentGetMsgTick = Time.time; } if 阅读全文
posted @ 2020-09-28 10:37 werky 阅读(945) 评论(0) 推荐(0) 编辑
摘要: void Update() { if(Input.GetKeyUp(KeyCode.D)) { flag = !flag; } if (flag) { open_txt_btn.GetComponent<CanvasGroup>().alpha = 1; } else { open_txt_btn. 阅读全文
posted @ 2020-09-28 10:19 werky 阅读(3903) 评论(0) 推荐(0) 编辑
摘要: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using System.Net; //IPAddress,IPEndPoint using Sy 阅读全文
posted @ 2020-09-27 16:56 werky 阅读(602) 评论(0) 推荐(0) 编辑
摘要: using System.IO;using System.Xml; void Awake() { StreamReader sr = new StreamReader(xmlPath); string xmlstr = sr.ReadToEnd(); sr.Close(); XmlDocument 阅读全文
posted @ 2020-09-26 16:55 werky 阅读(168) 评论(0) 推荐(0) 编辑
摘要: float lastTime; void start(){ lastTime=Time.time; } void update(){ if(Time .time -lastTime > 3.0f) { function(); lastTime = Time.time; } } 阅读全文
posted @ 2020-09-19 19:51 werky 阅读(774) 评论(0) 推荐(0) 编辑
摘要: using UnityEngine.UI; public Button Btn; Btn.onClick.AddListener(Query); 按钮触发事件: 先把按钮挂到类上, 在类里写一个public函数,把代码挂到按钮上,按钮的OnClick里通过加号“+”可以找到这个函数,表示每次点击该按 阅读全文
posted @ 2020-09-16 00:18 werky 阅读(1188) 评论(0) 推荐(0) 编辑
摘要: void Update() { //按A全屏 if (Input.GetKey(KeyCode.A)) { Screen.SetResolution(1366, 768, true); //设置分辨率 Screen.fullScreen = true; //设置成全屏, } // 按ESC退出全屏 阅读全文
posted @ 2020-09-03 10:27 werky 阅读(1462) 评论(0) 推荐(0) 编辑