Exemple #1
0
        /// <summary>
        /// 从IFS或StreamingAssets目录同步加载资源
        /// </summary>
        public void Load(string pkgPath, bool outside)
        {
            if (outside)
            {
                Load(FileUtil.GetIFSExtractPath(), pkgPath);
            }
            else
            {
                // load from StreamingAssets
#if UNITY_ANDROID && !UNITY_EDITOR
                string realPath = FileUtil.CombinePath(pkgPath, OriginPath);
                byte[] data     = NativeUtil.Android_ReadFileInAssets(realPath);
                if (data != null)
                {
                    OnBinaryLoaded(data);
                }
#else
                Load(FileUtil.GetStreamingAssetsPath(), pkgPath);
#endif
            }
        }