private void RequestAsset(Entity entity, MandatoryAssetsFirstLoadingComponent.MandatoryRequestsState requestsState, NotCompletedMandatoryAssetsLoadingNode mandatoryLoading) { AssetRequestComponent assetRequest = new AssetRequestComponent(100); mandatoryLoading.mandatoryAssetsFirstLoading.MarkAsRequested(assetRequest, requestsState); entity.AddComponent(assetRequest); this.ShowLoadingScreenIfAllAssetsAreRequired(mandatoryLoading); }
protected override void Activate() { this.entity.Entity.AddComponent(new AssetReferenceComponent(this.audioResourcesRef)); AssetRequestComponent component = new AssetRequestComponent { AssetStoreLevel = AssetStoreLevel.MANAGED }; this.entity.Entity.AddComponent(component); }
public void RequestWarmupResources(NodeAddedEvent e, WarmupResourcesNode node) { AssetRequestComponent component = new AssetRequestComponent { AssetStoreLevel = AssetStoreLevel.STATIC, Priority = 100 }; node.Entity.AddComponent(component); if (< > f__am$cache0 == null) {
public void ProcessRequest(AssetRequestEvent e, Node any) { Entity entity = base.CreateEntity("AssetLoadByEventRequest"); entity.AddComponent(new AssetReferenceComponent(new AssetReference(e.AssetGuid))); LoadByEventRequestComponent component = new LoadByEventRequestComponent { ResourceDataComponentType = e.ResourceDataComponentType, Owner = any.Entity }; entity.AddComponent(component); AssetRequestComponent component2 = new AssetRequestComponent { Priority = e.Priority, AssetStoreLevel = e.StoreLevel }; entity.AddComponent(component2); e.LoaderEntity = entity; }
private void StartLoading() { this.startedLoading = true; if (this.progressBar != null) { this.progressBar.SetActive(true); } Entity entity = EngineService.Engine.CreateEntity("ScenesLoader"); entity.AddComponent(new AssetReferenceComponent(this.sceneListRef)); AssetRequestComponent component = new AssetRequestComponent { AssetStoreLevel = AssetStoreLevel.MANAGED }; entity.AddComponent(component); SceneLoaderComponent component2 = new SceneLoaderComponent { sceneName = string.Empty + base.GetInstanceID() }; entity.AddComponent(component2); }
public void MarkAsRequested(AssetRequestComponent assetRequest, MandatoryRequestsState mandatoryRequestsState) { this.currentRequestsState |= mandatoryRequestsState; this.assetsRequests.Add(assetRequest); }
public bool IsAssetRequestMandatory(AssetRequestComponent assetRequest) => this.assetsRequests.Contains(assetRequest);