查了一堆文档,总之没有解决方案。
感觉很奇葩,VS的编译已经过了,但是unity一直还报错,难道是unity的引用里面没有writealltext这个方法,刚开始学也不知道到底是不是。
换了一种io操作
public void Write()
{
using (System.IO.StreamWriter sw = new System.IO.StreamWriter(path, false, System.Text.Encoding.UTF8))
{
sw.Write(path);
}
}
public string Read()
{
return new StreamReader(path, Encoding.Default).ReadToEnd().ToString();
}
这段代码可以替代writealltext和readalltext。
12-22再次碰到相同问题,果然逃避是不可能解决问题的
看了一下文档是因为平台的问题,所以换一种平台就好了
解决方案:
file–>build&settings–>在platform中选中一个平台–> switch platform
http://game.ceeger.com/Manual/PlatformDependentCompilation.html
这个是文档。
ps:还看到了一个比较好玩的,在unity中.net framework版本为2.0,分为简版和完整版。