76
Watch
2.8k
Star
412
Fork
570
Issue

Write your game with TypeScript in UE4 or Unity. Puerts can be pronounced as pu-erh TS(普洱TS)

Tencent
Tencent
pushedAt 14 hours ago

Tencent/puerts

Logo

license unreal unity PRs Welcome CI

(English README Available)

What?

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

  • 提供了一个JavaScript运行时

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

Why?

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

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

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

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

How to Install | 最新版本安装

  • click it ->unreal

  • click it ->unity

Changelog

Known problem | 已知问题

各发布版本已知的,影响较大的bug及其修复办法

Example | 编程样例

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());

FAQ | 常见问题

Manual | 使用文档

Detailed Readme | 详细信息

Example | 示例

Unreal

Unity

Supported Engine | 引擎

  • unreal engine 4.22 ~ latest

  • unity 5 ~ latest

Supported Platform | 平台

  • iOS,Android,Windows,Macos

  • 任意.net环境 | Any .net project

Ask for help | 技术支持

Github Discussion

QQ群:942696334

UE4专属群:689643903

开发博客

知乎专栏

ucloud ads