Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
                };
            }
        }
Ejemplo n.º 3
0
        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);
                        };
                    };
                }
            }
        }