|
|
@@ -10,10 +10,10 @@ With Async scripts we can perform heavy duty operations or reach out to an api w
|
|
|
## Code
|
|
|
### Async Collision trigger
|
|
|
In a previous tutorial we made a collision trigger script that would notify the user once an object is passing through it. We can make a similar script using Async script.
|
|
|
-[!code-csharp[collisiontriggerdemo](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\05_Async\AsyncCollisionTriggerDemo.cs)]
|
|
|
+[!code-csharp[AsyncCollisionTrigger](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\05_Async\AsyncCollisionTriggerDemo.cs)]
|
|
|
|
|
|
### Retrieving data from a web api
|
|
|
-In a previous tutorial we made a collision trigger script that would notify the user once an object is passing through it. We can make a similar script using Async script.
|
|
|
-[!code-csharp[collisiontriggerdemo](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\05_Async\AsyncWebApi.cs)]
|
|
|
+Another common usecase for async scripts, is retrieving data from a web API. Depending on the speed of the API and the amount of data to be be retrieved this mostly take up somewhere between 20 milliseconds and 2 seconds.
|
|
|
+[!code-csharp[AsyncWebApi](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\05_Async\AsyncWebApi.cs)]
|
|
|
|
|
|
|