Exemple #1
0
        public static bool IsFileExistsInStreamingAssets(string path)
        {
#if PROFILE_FILE
            Profiler.BeginSample("FileUtils.IsFileExistsInStreamingAssets");
#endif

#if UNITY_ANDROID && !UNITY_EDITOR
            bool res = FileUtilsAndroid.IsFileExistsInAppJar(path);
#else
            var  streamingPath = Application.streamingAssetsPath + "/" + path;
            bool res           = File.Exists(streamingPath);
#endif

#if PROFILE_FILE
            Profiler.EndSample();
#endif
            return(res);
        }
Exemple #2
0
        public static bool CopyFile(string srcfile, string dstfile, bool overwrite)
        {
#if UNITY_ANDROID && !UNITY_EDITOR
            if (FileUtilsAndroid.IsFileExistsInAppJar(srcfile))
            {
                return(FileUtilsAndroid.CopyFileFromAppJar(srcfile, dstfile, overwrite));
            }
            else
            {
                string fullpath = GetFullPathOfFile(srcfile);
                File.Copy(fullpath, dstfile, overwrite);
                return(true);
            }
#else
            string fullpath = GetFullPathOfFile(srcfile);
            File.Copy(fullpath, dstfile, overwrite);
            return(true);
#endif
        }