-
Notifications
You must be signed in to change notification settings - Fork 6
Async Await with C# Task
David edited this page Oct 8, 2022
·
1 revision
// C#
public class Foo : MonoBehaviour {
public async Task<string> GetAsyncString() {
await Task.Delay(1000);
return "GetAsyncString";
}
public async Task DoAsyncMethod() {
await Task.Delay(1000);
print("DoAsyncMethod");
}
}
// TS
var foo = require("foo")
async function test() {
const text = await foo.GetAsyncString()
log(text)
await foo.DoAsyncMethod()
}
test()