private async Task BuildModel(String modelName) { lock (blocks) { blocks.Clear(); } VoxImporter modelReader = new VoxImporter(true); modelReader.BlockConstructed += modelReader_BlockConstructed; var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(modelName); Stream stream = await file.OpenStreamForReadAsync(); await Task.Run(async() => { await modelReader.ReadMagica(stream); }); }
private async Task BuildModel(String modelName) { lock (blocks) { blocks.Clear(); } VoxImporter modelReader = new VoxImporter(true); modelReader.BlockConstructed += modelReader_BlockConstructed; var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(modelName); Stream stream = await file.OpenStreamForReadAsync(); await Task.Run(async () => { await modelReader.ReadMagica(stream); }); }