@Singtaa: Please consider leaving a review on the Asset Store if you enjoy using OneJS. It really helps us a lot! And, I promise it'll take less time than debugging your last script.😊 Oh also, OneJS V2 is now out of preview!
Menu

Async Await with C# Task

CS
// 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
// TS
var foo = require("foo")

async function test() {
    const text = await foo.GetAsyncString()
    log(text)
    await foo.DoAsyncMethod()
}

test()