Unity 各文件夹路径在不同平台的读写

来源:互联网 发布:王者荣耀用户数据分析 编辑:程序博客网 时间:2024/06/05 09:34


 // 定义构造函数    public PathUtil()    {        dataPath =#if  !UNITY_EDITOR && (UNITY_ANDROID||UNITY_IPHONE)        Application.dataPath;#elif UNITY_EDITOR "file://" + Application.dataPath;#else      string.Empty;#endif        streamingAssetsPath =#if  !UNITY_EDITOR && (UNITY_ANDROID||UNITY_IPHONE)        Application.streamingAssetsPath;#elif UNITY_EDITOR "file://" + Application.streamingAssetsPath;#else      string.Empty;#endif        persistentDataPath =#if  !UNITY_EDITOR && (UNITY_ANDROID||UNITY_IPHONE) "file:///" + Application.persistentDataPath;#elif UNITY_EDITOR "file:///" + Application.persistentDataPath;#else      string.Empty;#endif    }


阅读全文
1 0
原创粉丝点击