Unity3d 在不一样设备中的文件读写 的路径

 

Application.dataPath : 数据路径

 
Unity Editor:  <path tp project folder>/Assets
Unity 编辑器: <工程文件夹的路径>/Assets 

Mac player:  <path to player app bundle>/Contents
Mac播放器: <到播放器应用的路径>/Contents 

i Phone player:  <path to player app bundle>/<AppName.app>/Data
iPhone播放器: <到播放器应用的路径>/<AppName.app>/Data 

Win player:  <path to executablename_Data folder>
Win播放器: < 包含可执行播发器的文件夹的路径>\Data 

Dashboard widget:  <path to the dashboard widget bundle>
Dasboard窗口: < dashboard widget bundle的路径> 

Web player:  The absolute url to the player data file folder (without the actual data file name)
网络播放器: 到播放器数据文件夹的绝对路径(没有实际的数据文件名称)
 

 

 在IOS真机设备中 须要在<path to player app bundle>/Documents路径下才能够读写。  网络

unity3d中经过以下操做获取Document文件路径app

    public string Path
    {
        get{
            string    path=null;
            if(Application.platform==RuntimePlatform.IPhonePlayer)
            {
                path= Application.dataPath.Substring (0, Application.dataPath.Length - 5);
                path = path.Substring(0, path.LastIndexOf('/'))+"/Documents/";    
            }
            else
            {
                path=Application.dataPath+"/Resource/GameData/";
            }
            return path;
        }     
    }
编辑器

相关文章
相关标签/搜索