Ejemplo n.º 1
0
        public static void Init(OnInitFinished finishedCallback)
        {
#if LOADER_BUNDLE
            string            assetFilePath     = AssetConst.GetAssetDetailConfigFullPathForBundle();
            AssetDetailConfig assetDetailConfig = JSONReader.ReadFromFile <AssetDetailConfig>(assetFilePath);
            assetDetailConfig.InitConfig();

            string             bundleFilePath     = AssetConst.GetBundleDetailConfigFullPath();
            BundleDetailConfig bundleDetailConfig = JSONReader.ReadFromFile <BundleDetailConfig>(bundleFilePath);
            bundleDetailConfig.InitConfig();

            loader = new BundleLoader();
            loader.DoInitialize(assetDetailConfig, (result) =>
            {
                Debug.Log("LoaderUtill::Init->init finished result = " + result);
                finishedCallback?.Invoke(result);
            }, AssetConst.GetRootFullDirForBundle(), bundleDetailConfig);
#elif LOADER_RESOURCE
#else
            string            assetFilePath     = AssetConst.GetAssetDetailConfigFullPathForDatabase();
            AssetDetailConfig assetDetailConfig = JSONReader.ReadFromFile <AssetDetailConfig>(assetFilePath);
            assetDetailConfig.InitConfig();

            loader = new DatabaseLoader();
            loader.DoInitialize(assetDetailConfig, (result) =>
            {
                Debug.Log("LoaderUtill::Init->init finished result = " + result);
                finishedCallback?.Invoke(result);
            });
#endif
            loaderBehaviour = PersistentUObjectHelper.CreateComponent <LoaderBehaviour>();
            loaderBehaviour.SetLoader(loader);
        }
        public static AssetDependencyConfig GetAssetDependencyConfig()
        {
            string filePath = GetConfigFilePath();
            AssetDependencyConfig dependencyConfig;

            if (File.Exists(filePath))
            {
                dependencyConfig = JSONReader.ReadFromFile <AssetDependencyConfig>(filePath);
            }
            else
            {
                dependencyConfig = new AssetDependencyConfig();
            }

            return(dependencyConfig);
        }
        public static BundleBuildData ReadBuildData()
        {
            BundleBuildData bundlePackConfig = null;

            string configPath = GetBundleBuildDataFilePath();

            if (File.Exists(configPath))
            {
                bundlePackConfig = JSONReader.ReadFromFile <BundleBuildData>(configPath);
            }

            if (bundlePackConfig == null)
            {
                bundlePackConfig = new BundleBuildData();
            }
            return(bundlePackConfig);
        }