UniTask | efficient allocation free async/await integration | Android library
kandi X-RAY | UniTask Summary
kandi X-RAY | UniTask Summary
unitask ===
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of UniTask
UniTask Key Features
UniTask Examples and Code Snippets
Community Discussions
Trending Discussions on UniTask
QUESTION
I am using UniTask in Unity 2020.3. And I want to call an async method which returns a UniTask in Unity Event Function.
For some reason, I cannot change the event function to async version, is there any other way to call it?
Such as, wrap the async method into a callback function?
For example, I have an async function like this:
...ANSWER
Answered 2021-Dec-17 at 03:38I would solve this by changing the signature to async void Start()
. That works. If you need Update
to be delayed until Start
finishes, change Start
to a coroutine and use UniTask's API for creating an iterator from a task (which you will yield).
Note: I don't use the UniTask
library, but it seems pretty equivalent to Async Await Utils
. Both provide the GetAwaiter()
extension method for common Unity types. There is certainly some function that lets a coroutine wait for a task (by wrapping it in an IEnumerator
).
QUESTION
I want to interrupt the process when it responds to a specific object.
I wanted to interrupt SinkDeath()
by sorting through the tags of the object and changing the value of the bool to true, but it doesn't work!
script1
...ANSWER
Answered 2021-Aug-15 at 06:22add the following to your Script1.cs :
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install UniTask
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page