Docs says onFinished is called when tasks are ‘processed’ vs onTasksDoneObservable is when they are ‘executed’. I guess I need clarification what is the difference?
what I see is that my tasks (for example loading a bunch of textures) is actually all completed when onFinished is called. The tasks array contains my texture tasks and it apears those tasks have actually loaded the textures. Then onTasksDoneObservable ends up being called after that but the tasks array in there is empty. So I’m a bit confused. No repro on the playground at the moment but wanted to understand the differences here first.
ps: ultimately what im trying to do is chain a group of tasks together. So for example , first loading all texture, then loading models only after all textures are loaded successfully. So these observables are critical to hook into those events.
ok looks like omits any successful tasks. I was just hoping to check task status like this as per documentation:
assetsManager.onTasksDoneObservable.add(function(tasks) {
var errors = tasks.filter(function(task) {return task.taskState === BABYLON.AssetTaskState.ERROR});
var successes = tasks.filter(function(task) {return task.taskState !== BABYLON.AssetTaskState.ERROR});
});
im not understanding your question… the resulting array onTasksDoneObservable is empty. There are no error or success tasks in there as its an empty array. no data. That array should not be empty correct? So this is not behaving as documented…