Unity 5.3和.NET | AppendText& CreateText

时间:2015-12-10 15:10:47

标签: unity3d

即使我已经.NET 2.0 Subset.NET 2.0的{​​{1}}的API兼容级别已更改为Edit->Project Settings->Player,但升级到Optimizations后我仍然会以下两条错误消息:

Unity 5.3.0

他们参考以下代码片段:

`System.IO.File' does not contain a definition for `AppendText'
`System.IO.File' does not contain a definition for `CreateText'

如何解决此问题?

1 个答案:

答案 0 :(得分:1)

你是否尝试过这种情况?

using (var f = new StreamWriter("file path", true))
{
    f.WriteLine("appended text");
    f.Flush();
}