Unity 技术积累

  • Unity中Android和iOS的StreamingAsset路径
  • string StreamAssetPath {
        get {
            string filePath = "";
            #if UNITY_ANDROID && !UNITY_EDITOR
                filePath = "jar:file://" + Application.dataPath + "!/assets/" + flodername + "/";
            #elif UNITY_IPHONE && !UNITY_EDITOR
                filePath = Application.dataPath + "/Raw/";
            #elif UNITY_STANDALONE_WIN || UNITY_EDITOR
                filePath = "file://" + Application.dataPath + "/StreamingAssets" + "/" + flodername + "/";
            #else
                // TODO
            #endif
            return filePath;
        }
    }
    

    欢迎留言

    avatar
      Subscribe  
    Notify of