public static void LoadObjects() { LogManager.GetCurrentClassLogger().Info($"<Color=Olive><b>" + "Load Objects started..." + "</b></Color>"); ResetObjectsCounter(); WorldData.ObjectsAreLoaded = false; ObjectResourses.ClearResourses(); LoadPrefabObjects(WorldData.WorldStructure.Objects); }
public static void LoadResourcesApi(AssetInfo assetInfo, PrefabObject o) { string assetBundleUri = o.Resources.Bundle; if (assetInfo.Resources == null) { return; } foreach (string assetName in assetInfo.Resources) { new RequestAsset(assetName, assetBundleUri).OnFinish += response2 => { ResponseAsset responseResource = (ResponseAsset)response2; ObjectResourses.AddResourse(responseResource.Asset); }; } }
public static void LoadResourcesTar(AssetInfo assetInfo, PrefabObject o) { string assetBundleUri = o.Resources.Bundle; if (assetInfo.Resources != null) { foreach (string resource in assetInfo.Resources) { new RequestTar(assetBundleUri).OnFinish += response => { var bundle = ((ResponseTar)response).ByteData; new RequestLoadAssetFromMemory(resource, bundle).OnFinish += response2 => { ResponseAsset responseResource = (ResponseAsset)response2; ObjectResourses.AddResourse(responseResource.Asset); }; }; } } }