Unity3D 资源路径


  • On a desktop computer (Mac OS or Windows) the location of the files can be obtained with the following code:

     path = Application.dataPath + "/StreamingAssets";
    
  • On iOS, you should use:

     path = Application.dataPath + "/Raw";
    
  • On Android, you should use:

     path = "jar:file://" + Application.dataPath + "!/assets/";
  发现在IOS上用   string filepath = Application.dataPath +"/Raw/test.xml";
              XmlDocument xmlDoc = new XmlDocument();
              xmlDoc.Load(filepath);
    也可以加载xml文件。 

你可能感兴趣的:(Unity3D 资源路径)