- 屏幕截图,移动平台上,文件名附加到持久数据路径Application.persistentDataPath,第二个参数大于1生成更高分辨率
ScreenCapture.CaptureScreenshot("test01.png", 0);
- 持久数据的路径(只读)Application.persistentDataPath
- 流动资产的路径(只读)Application.streamingAssetsPath
- 短暂的缓存路径(只读)Application.temporaryCachePath
- Application相关(第三行如果是编辑模式也会写清楚)
print(Application.isEditor);
print(Application.isPlaying);
print(Application.platform);
- 日志相关
string output = "";
string stack = "";
string logType = "";
int tp = 0;
void Update()
{
Debug.Log("stack:" + stack);
Debug.Log("logType:" + logType);
Debug.Log("tp:"+(tp++));
Debug.Log("output:" + output);
}
void OnEnable()
{
Application.logMessageReceived += MyCallback;
}
void OnDisable()
{
Application.logMessageReceived -= MyCallback;
}
void MyCallback(string logString, string stackTrace, LogType type)
{
output = logString;
stack = stackTrace;
logType = type.ToString();
}
- 异步加载场景相关(待补充)