I'm new to RealityKit and facing the following issue -
I'm trying to load 8 models asynchronously using the following code -
cancellable = Entity.loadModelAsync(named: "m1")
.append(Entity.loadModelAsync(named: "m2"))
.append(Entity.loadModelAsync(named: "m3"))
.append(Entity.loadModelAsync(named: "m4"))
.append(Entity.loadModelAsync(named: "m5"))
.append(Entity.loadModelAsync(named: "m6"))
.append(Entity.loadModelAsync(named: "m7"))
.append(Entity.loadModelAsync(named:"m8"))
.collect()
.sink(receiveCompletion: { loadCompletion in
if case let .failure(error) = loadCompletion {
print("Unable to load model \(error)")
}
self.cancellable?.cancel()
}, receiveValue: { entities in
})
//cancellable is an instance property defined as var cancellable:AnyCancellable?
The code works as expected. However there is an Xcode issue I'm facing - the editor constantly gets stuck at "Indexing: Processing Files" and subsequently the Build process gets stuck too. This only happens when the number of models in the above chain is more than 3-4. Is there any way to break down the above loading step into smaller parts, without needing to load the models individually (i.e. without .append)?