private async Task LoadZoneObjects(Zone zone) { Task[] objTasks = new Task[zone.Objects.Count]; for (int i = 0; i < zone.Objects.Count; i++) { Object zoneObject = zone.Objects[i]; objTasks[i] = CreateActorInstances(zoneObject); statusReporter.ReportProgress("Loading Zone Objects", i, zone.Objects.Count); await new WaitForUpdate(); } foreach (Task objTask in objTasks) { await objTask; } statusReporter.ReportProgress("Loading Zone Objects", zone.Objects.Count, zone.Objects.Count); zoneObjects.transform.localScale = new Vector3(-1, 1, 1); }
public async Task LoadPacks(StatusReporter progress) { string[] packPaths = Directory.GetFiles(packDir, "*.pack", SearchOption.TopDirectoryOnly); Packs = new Pack[packPaths.Length]; Task <Pack>[] packTasks = new Task <Pack> [packPaths.Length]; for (int i = 0; i < packPaths.Length; i++) { string path = packPaths[i]; packTasks[i] = LoadPack(path); } for (int i = 0; i < packTasks.Length; i++) { Packs[i] = await packTasks[i]; progress.ReportProgress("Loading Packs", i, packPaths.Length); } }
public async Task LoadSystem(StatusReporter reporter) { await new WaitForBackgroundThread(); actorDefinitions.Clear(); AssetRef[] actorDefs = assetManager.GetAssetsByType(AssetType.ADR); for (int i = 0; i < actorDefs.Length; i++) { AssetRef assetRef = actorDefs[i]; Adr adr = assetManager.CreateAsset <Adr>(assetRef); if (adr != null) { actorDefinitions.Add(adr.Name, adr); } reporter.ReportProgress("Loading Actor Definitions", i, actorDefs.Length); } }
public async Task LoadSystem(StatusReporter progress) { await new WaitForBackgroundThread(); materialDefinitions = assetManager.LoadPackAsset <MaterialDefinitions>(MATERIALS_ASSET); progress.ReportProgress("Loading Material Definitions", 1, 1); }