注释
在打包完成了测试不方便,我们可以把打印信息存在文本里,然后可以再运行打包程序的时候可以查看
cpp
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
public class DebugToCall
{
public static string path = "D:\\Log.txt";
public static void Log(string log)
{
FileStream file;
if (!File.Exists(path))
{
file = File.Create(path);
}
else
{
file = File.Open(path,FileMode.Open);
}
file.Dispose();
UnityEngine.Debug.Log(log);
File.AppendAllText(path, log + "\r", Encoding.UTF8);
file.Close();
}
}