我从铁蓬2升至铁蓬3,但在升级后,我不再能够取得产出。
My class:
public class UnityLogWriter : StreamWriter
{
private readonly Action<string> logger;
private string buffer = "";
public UnityLogWriter(Action<string> logger, Stream s) : base(s)
{
if (logger == null)
{
throw new ArgumentNullException("logger");
}
this.logger = logger;
}
public override void Write(string value)
{
base.Write(value);
buffer += value;
var lines = buffer.Split(
);
for (var i = 0; i < lines.Length; ++i)
{
if (i == lines.Length - 1)
{
buffer = lines[i];
}
else
{
logger(lines[i]);
}
}
}
}
My code that redirects output:
var infoStream = new MemoryStream();
var infoWriter = new UnityLogWriter(Debug.Log, infoStream);
engine.Runtime.IO.SetOutput(infoStream, infoWriter);
该法典使用“铁p”2,但使用“铁p3”没有产出。
参看Documentation。 关于“铁p”3的改动,其中包括关于重新定位产出的一节,但我不知道如何执行这一信息。