uis
uis copied to clipboard
Async load of items
It would be awesome if it could load items in a async way.
Hm.. but you can implement you own async load in OnFill method.
It would be awesome if it could load items in a async way.
use Corountine make load data asynchronously pretty easy~
class Foo
{
Coroutine task;
public void OnFilled()
{
if(null!=task)StopCoroutine(task);
task = StartCoroutine();
}
IEnumerator SomeTask()
{
async operation here
}
}
It would be awesome if it could load items in a async way.
use Corountine make load data asynchronously pretty easy~
class Foo { Coroutine task; public void OnFilled() { if(null!=task)StopCoroutine(task); task = StartCoroutine(); } IEnumerator SomeTask() { async operation here } }
Coroutine != async
but in unity Coroutine = asynchronous operation ≈ async
it is easy to start onfilled and stop onrecycle。 if use Task,webgl not support yet and a little heavy and a bit more hard to cancel then coroutine as unitask support webgl but still need some logic to cancel it when cell recycle. so i sugguest coroutine
but in unity Coroutine = asynchronous operation ≈ async
it is easy to start onfilled and stop onrecycle。 if use Task,webgl not support yet and a little heavy and a bit more hard to cancel then coroutine as unitask support webgl but still need some logic to cancel it when cell recycle. so i sugguest coroutine
In Unity coroutines works in main thread! It's not async. Task and Coroutine are two different things.