in English
puerts is a TypeScript programming solution within game engines.
-
provides a JavaScript Runtime
-
allows TypeScript to access the host engine(module-binding on the JavaScript level and generating TypeScript declarations)
说中文
puerts是游戏引擎下的TypeScript编程解决方案
-
提供了一个JavaScript运行时
-
提供通过TypeScript访问宿主引擎的能力(JavaScript层面的绑定以及TypeScript声明生成)
in English
-
Facililates game building processes by combining JavaScript packages and toolchains with the rendering power of professional game engines
-
In contrast to lua script, TypeScript supports static type checking, which significantly improves code robustness and maintainability.
-
High efficiency: supports reflection binding throughout the platform (engine) - no extra steps (code generation) needed for development.
-
High performance:supports static binding throughout the platform (engine) - takes care of complex scenes
说中文
-
JavaScript生态有众多的库和工具链,结合专业商业引擎的渲染能力,快速打造游戏
-
相比游戏领域常用的lua脚本,TypeScript的静态类型检查有助于编写更健壮,可维护性更好的程序
-
高效:全引擎,全平台支持反射Binding,无需额外(生成代码)步骤即可开发
-
高性能:全引擎,全平台支持静态Binding,兼顾了高性能的场景
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
- Unreal Readme
- Unreal Manual
- Unreal debugging
- TypeScript and unreal engine interaction
- Template-based static binding
Unity
Unreal
-
QuickStart.ts : 演示TypeScript和UE4引擎互相调用
-
NewContainer.ts : 演示容器的创建
-
AsyncTest.ts : 将异步加载蓝图,Delay封装成async/await
-
UsingWidget.ts : UI加载,绑定事件,获取数据的演示
-
UsingMixin.ts:演示mixin功能的使用
Unity
-
-
01_JsCallCs : js调用c#
-
02_Require : 加载js文件
-
03_Callback : 回调基本演示
-
04_JsBehaviour : 用js模拟MonoBehaviour
-
05_Typescript : 包含了大部分TypeScript和C#互相调用的演示
-
06_UIEvent :UI事件的演示
-
-
unreal engine 4.22 ~ latest
-
unity 5 ~ latest
-
iOS,Android,Windows,Macos
-
任意.net环境 | Any .net project
QQ群:942696334
UE4专属群:689643903