public static void Initialize(string basePath) { if (!isInitialized) { Debug.Log("Initializing ABM shim"); CheckInit(); GameObject gameObject = new GameObject("AssetBundleManager", typeof(AssetBundleManager)); UnityEngine.Object.DontDestroyOnLoad(gameObject); // LoadedAssetBundle.Init(basePath); BaseDownloadingURL = basePath; isInitialized = true; InitAddComponent.AddComponents(gameObject); } }
public static void Initialize(string basePath) { if (AssetBundleManager.isInitialized) { return; } AssetBundleManager.m_BaseDownloadingURL = basePath; GameObject go = new GameObject(nameof(AssetBundleManager), new System.Type[1] { typeof(AssetBundleManager) }); Object.DontDestroyOnLoad((Object)go); if (AssetBundleManager.MainBundle == null) { AssetBundleManager.MainBundle = AssetBundleManager.ManifestAdd("abdata"); } if (Directory.Exists(basePath)) { IEnumerable <string> source = ((IEnumerable <string>)Directory.GetFiles(basePath, "*.*", SearchOption.TopDirectoryOnly)).Where <string>((Func <string, bool>)(s => Path.GetExtension(s).IsNullOrEmpty())); // ISSUE: reference to a compiler-generated field if (AssetBundleManager.\u003C\u003Ef__mg\u0024cache0 == null) { // ISSUE: reference to a compiler-generated field AssetBundleManager.\u003C\u003Ef__mg\u0024cache0 = new Func <string, string>(Path.GetFileNameWithoutExtension); } // ISSUE: reference to a compiler-generated field Func <string, string> fMgCache0 = AssetBundleManager.\u003C\u003Ef__mg\u0024cache0; foreach (string manifestAssetBundleName in source.Select <string, string>(fMgCache0).Where <string>((Func <string, bool>)(s => s != "abdata"))) { AssetBundleManager.ManifestAdd(manifestAssetBundleName); } } AssetBundleManager.isInitialized = true; InitAddComponent.AddComponents(go); }