Ejemplo n.º 1
0
        public void StartLoadAssetFromBundle(AssetBundlesLoadedEvent e, AssetDependenciesNode asset, [JoinAll] SingleNode <AssetBundleDatabaseComponent> db)
        {
            AsyncLoadingAssetComponent component = new AsyncLoadingAssetComponent {
                Request = CreateLoadAssetRequest(asset.assetReference.Reference, db.component, asset.assetBundlesLoadData)
            };

            asset.Entity.AddComponent(component);
            asset.Entity.RemoveComponentIfPresent <LoadAssetBundlesRequestComponent>();
        }
Ejemplo n.º 2
0
        public void CompleteLoadAssetFromBundle(AssetBundlesLoadedEvent e, AssetDependenciesNode assetNode, [JoinAll] SingleNode <AssetBundleDatabaseComponent> db)
        {
            AssetInfo assetInfo = db.component.AssetBundleDatabase.GetAssetInfo(assetNode.assetReference.Reference.AssetGuid);
            Entity    entity    = assetNode.Entity;
            Object    data      = this.ResolveAsset(assetInfo, assetNode.assetBundlesLoadData.LoadedBundles);

            this.AttachResourceToEntity(data, assetInfo.ObjectName, entity);
            assetNode.assetReference.Reference.SetReference(data);
            this.CleanLoadingRequest(assetNode.Entity);
        }