【问题标题】:Trouble when using System.io.File in Unity在 Unity 中使用 System.io.File 时出现问题
【发布时间】:2014-04-11 10:19:24
【问题描述】:

当我尝试从 Unity 构建 windowsPhone 8 和 webPlayer 游戏时遇到以下问题: “错误 CS0117:System.IO.File' does not contain a definition forWriteAllLines' " 但是当我为android平台构建游戏时,System.io.File工作正常,有人告诉我为什么吗?

【问题讨论】:

    标签: unity3d unityscript


    【解决方案1】:

    出于安全原因,Web Player 无法使用此功能(Unity 不希望人们制作可以访问文件系统的网站),并且Windows 应用商店应用程序无法使用> 和 Windows Phone 8 仅仅是因为这些平台中不存在此 API。它已被Windows.Storage API 取代,这就是您必须用于这些平台(WSA 和 WP8)的内容。

    但是...不是那么简单:Windows.Storage 不适用于 Android 等,因此您必须使用像 #if UNITY_WP8 这样的编译指令。你有UNITY_WINRTUNITY_WP8UNITY_METRO

    我建议您查看 these porting guides,他们会为您提供在 Unity 中为 Windows PhoneWindows 应用商店应用程序 工作的好主意。 p>

    【讨论】:

      猜你喜欢
      • 2021-08-10
      • 2022-01-27
      • 1970-01-01
      • 1970-01-01
      • 2023-03-05
      • 1970-01-01
      • 1970-01-01
      • 2021-12-16
      • 2010-11-09
      相关资源
      最近更新 更多