1 using System;
2 using System.IO;
3 using System.Text;
4 /// <summary>
5 /// 自定义Unity本地Debug
6 /// </summary>
7 public class MyDebug {
8
9 private static string path =
@"C:/MyDebug.txt";
10 public static void Log(
string infor)
11 {
12 if (!
File.Exists(path))
13 {
14 File.Create(path);
15 }
16 FileStream fs =
new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write);
17 StreamWriter sw =
new StreamWriter(fs);
18 sw.WriteLine(infor +
" " +
DateTime.Now);
19 sw.Close();
20 sw.Dispose();
21 fs.Close();
22 fs.Dispose();
23 }
24 }
记录信息存储在本地,方便查看
转载请注明地址:http://www.cnblogs.com/Vincentblogs/p/4083028.html
QQ群:346738352 Unity技术交流群,讲纯粹的技术。
转载于:https://www.cnblogs.com/Vincentblogs/p/4082239.html
相关资源:自定义的Unity日志系统