MCPcopy Create free account
hub / github.com/Tencent/puerts

github.com/Tencent/puerts @Unity_Plugin_10.28

Chat with this repo
repository ↗ · DeepWiki ↗ · release Unity_Plugin_10.28 ↗ · + Follow
10,658 symbols 24,827 edges 874 files 2,366 documented · 22% updated 5d agoUnity_v3.0.2 · 2026-04-01★ 6,125297 open issues

Browse by type

Functions 8,135 Types & classes 2,523
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Logo

license release PRs Welcome CI

(English README Available)

What?

puerts是游戏引擎下的TypeScript编程解决方案

  • 提供了一个JavaScript运行时

  • 提供通过TypeScript访问宿主引擎的能力(JavaScript层面的绑定以及TypeScript声明生成)

Why?

  • JavaScript生态有众多的库和工具链,结合专业商业引擎的渲染能力,快速打造游戏

  • 相比游戏领域常用的lua脚本,TypeScript的静态类型检查有助于编写更健壮,可维护性更好的程序

  • 高效:全引擎,全平台支持反射Binding,无需额外(生成代码)步骤即可开发

  • 高性能:全引擎,全平台支持静态Binding,兼顾了高性能的场景

安装

  • git clone https://github.com/Tencent/puerts.git

  • 拷贝插件到您项目

    • unreal engine

      • 拷贝puerts/unreal下的Puerts目录到您项目的Plugins目录下,可以参考unreal demo
    • unity

      • 拷贝puerts/unity/Assets下的所有内容到您项目的Assets目录下,可以参考unity demo

      • Plugins要单独下载releases,或者自行编译

编程样例

Unity

import {UnityEngine} from 'csharp'

UnityEngine.Debug.Log('hello world');
let gameObject = new UnityEngine.GameObject("testobject");
console.log(gameObject.name);
gameObject.transform.position = new UnityEngine.Vector3(1, 2, 3);

Unreal

import * as UE from 'ue'
import {argv} from 'puerts';
let world = argv.getByName("World") as UE.World;
let actor = world.SpawnActor(UE.MainActor.StaticClass(),
    undefined, UE.ESpawnActorCollisionHandlingMethod.Undefined, undefined, undefined) as UE.MainActor;
console.log(actor.GetName());
console.log(actor.K2_GetActorLocation().ToString());

调试

常见问题

使用文档

支持的引擎,平台

引擎

  • unreal engine 4.22 ~ 最新版本

  • unity 5 ~ 最新版本

平台

  • iOS,Android,Windows,Macos

  • 任意.net环境

详细信息

示例

Unreal自动绑定模式

  • FPS demo : 以一个FPS游戏例子演示如何使用Puerts的自动绑定模式

Unreal自创建虚拟机模式

Unity

技术支持

QQ群:942696334

UE4专属群:689643903

开发博客

知乎专栏

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 5,071
Function 3,064
Class 2,206
Enum 301
Interface 16

Languages

C++83%
C#7%
TypeScript6%
C3%

Modules by API surface

unreal/Puerts/ThirdParty/Include/v8/8.4.371.19/v8.h458 symbols
unreal/Puerts/ThirdParty/Include/v8/7.7.299/v8.h428 symbols
unreal/Puerts/ThirdParty/Include/v8/7.4.288/v8.h420 symbols
quickjs-build/quickjs/libbf.c239 symbols
quickjs-build/include/v8.h185 symbols
unreal/Puerts/PuertsEditor/CodeAnalyze.ts146 symbols
unreal/Puerts/Content/JavaScript/PuertsEditor/CodeAnalyze.js137 symbols
unreal/Puerts/Source/JsEnv/Private/PropertyTranslator.cpp114 symbols
unreal/Puerts/Source/JsEnv/Private/Gen/FVector_Wrap.cpp103 symbols
unreal/Puerts/ThirdParty/Include/asio/asio/experimental/impl/co_spawn.hpp96 symbols
quickjs-build/src/v8-impl.cc95 symbols
unity/Assets/Puerts/Src/PuertsDLL.cs92 symbols

For agents

$ claude mcp add puerts \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page