⚡
更易用 · 零配置
声明式 GetFunction / [TsMarshalAs],CSharp 懒绑定;无需 per-type Wrap 白名单。与 ZLua 同一套产品心智。
🟦
TypeScript 一等公民
官方 TsProject 工作流、csharp: 声明、进 Play 闸门;运行时仍只执行 emit 后的 ES module。
📦
Il2Cpp 就绪 · 双运行时
Editor Mono 便于迭代;Player Il2Cpp 走 C++ 桥,签名复用 stub,ByVal / Registry Marshal。
双向调用一览
- C# → JS
- JS/TS → C#
// Bootstrap
TsAppDomain.Initialize(LoadJsModule);
void Start()
{
var add = TsAppDomain.GetFunction<Func<int, int, int>>("app", "add");
Debug.Log(add(10, 20)); // 30
}// JsScripts/app.js (canonical: "app")
export function add(a, b) {
return a + b;
}import { Demo } from "csharp:Assembly-CSharp";
const d = new Demo();
d.x = 10;
console.log("Add:", Demo.Add(3, 5));