How to use Addressable w/ UniTask or async/await in Unity

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi welcome to my channel today let's talk about how we can use imitas with EOD addressable arrestable is an empty system that allows us to load assets form your local application or content delivery Network and whenever you hear that you're gonna use an i o operation such as a reservo the first thing comes to your mind is using editors although the unity manuals interests us to use the carotene approach to handle a vegetable personally I think the Unitas is a better approach or a similar way for some reasons first it is gonna return in value which match our code much cleaner because when you're using coroutine you have to assign the reference to somewhere else and by providing the return value we can actually isolate the method from external logic the second things is that the sinus approach gave us much readable code now let's start jump right into the code in here I haven't met us called get game motion which is an acid method and it's gonna return any task first I'm gonna initialize an Asin operation handle object and I'm going to use a restable DOT let's assess a scenes which have a type of game object and I'm gonna pass the assist reference which is the queue and as you can see the accents operation handles actually providers with a task which can return a tasks you can see right here and to convert it to Unitas I will use the as you test attention method let's take a look so in a task has for wires with an extension method for helping us Converse the normal shisha tasks so the reason that you should you Unitas instead of no more shisha cost is is run on the stack and the second tense is as if it has run on the equity loop system which runs perfectly fine on web share build and if you have some experience you will find out that no more shishatas don't actually perform it quite well on that platform now let's go back I'm gonna wait for that operation to be finished and it's gonna return the type of game object and I'm going to return that resource in a stop methods I'm gonna pass the reference to a gamer checkup with resource and I would do that by awaiting the get objects method to be finished then I'm gonna initiate the results let's take a look at the editor in the editor I will create a sample arrestable object I will use grid 3D objects I'm going to upgrade a queue I'm going to reset transform and I'm going to create a free file for me next I'm gonna click the addressable in the main camera I will assign the access to the field now I'm going to delete the objects from scene let's run it as you can see it's already initialized the queue right here for it now we're gonna write an attention methods to help us getting the assets which have been loads from the arrestable system from anywhere that we like I'm gonna call it the addressable editors attention and I just want to say that you can call it anything that you like for me that is my choosing name and I'm gonna create an attention method I would call it get emoji wish gonna extend from the access reference now I'm gonna copy all this kind of logic here and I'm gonna paste this here instead of the little reference I'm gonna pass the access reference here and I'm gonna ask a since cure and then I'm gonna return the results there you go so I can delete this method and I'm going to call Q dot get game object there you go and I think the Logics will stay the same let's take a look in any editor let's play as you can see the queue is being instantiated right here before we continue please smash the like button and subscribe to the channel I will really appreciate that now when I was skiing on the content of this video I come up with an repository called SS managements by true true forgive me if I pronounce it's wrong and it's basically is a way to convert UT arrestable using acetyl weight and it has a bunch of method here The Links of the package will be down in the descriptions and I think you should take a look if you guys want me to make a tutorial about this assets and I will research it and come up with a new video about it thank you for watching
Info
Channel: NotJustUnity
Views: 3,026
Rating: undefined out of 5
Keywords: Unity UniTask, Asynchronous Programming, C# Coroutine Alternative, Task Management, Performance Optimization, Unity Plugin, Multithreading, Async Await, Concurrency, Unity Development, Game Programming, Real-time Processing, Programming Paradigm, Code Efficiency, Resource Management, Unity Asset Store, Unity Game Engine, Programming Languages, Code Optimization, Unity Scripting, Unity Addressables, Asset Management, Asset Optimization, Efficient Asset Loading
Id: 0p0EGunlWTs
Channel Id: undefined
Length: 7min 13sec (433 seconds)
Published: Thu May 18 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.