Пример #1
0
        public static void Initialize(ResourceManagerArgs args)
        {
            _urls.Clear();
            _urls.AddRange(args.urls);
            if (_listener == null)
            {
                _listener = new EmptyAssetProviderListener();
            }

            JobScheduler.Initialize();

            if (_assetProvider != null)
            {
                _assetProvider.Close();
            }

#if UNITY_EDITOR
            if (_analyzer == null)
            {
                if (!string.IsNullOrEmpty(args.listDataPath))
                {
                    var listDataPath = NormalizedListPath(args.listDataPath);
                    _analyzer = new Analyzer.DefaultAssetsAnalyzer(listDataPath);
                }
            }

            if (_analyzer != null)
            {
                _analyzer.Begin();
            }

            if (args.devMode)
            {
                _assetProvider = new AssetDatabaseAssetProvider(args.asyncSimMin, args.asyncSimMax);
            }
            else
#endif
            {
                _assetProvider = new BundleAssetProvider();
            }

            args.oninitialize?.Invoke();
            _assetProvider.Open(args);
            if (args.oncomplete != null)
            {
                _assetProvider.completed += args.oncomplete;
            }
        }
Пример #2
0
 public static void Close()
 {
     if (_assetProvider != null)
     {
         _assetProvider.Close();
     }
 }