Skip to content

Latest commit

 

History

History
110 lines (65 loc) · 3.13 KB

README.md

File metadata and controls

110 lines (65 loc) · 3.13 KB

Logo

license release PRs Welcome CI

What?

puerts is a TypeScript programming solution within game engines.

  • provides a JavaScript run-time

  • allows TypeScript to access the host engine(module-binding on the JavaScript level and generating TypeScript declarations)

Why?

  • 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) needes for development.

  • High performance:supports static binding throughout the platform (engine) - takes care of complex scenes

Installation

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

  • Copying the plugin to your project

    • unreal engine

      • copy Puerts under puerts/unreal to your project's Plugins folder - please refer to unreal demo
    • unity

      • copy all contents under puerts/unity/Assets to your project's Assets folder - please refer to unity demo

      • Plugins needs to be either downloaded from releases or complied by yourself.

Code samples

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

Debugging

FAQ

Manual

Available on

Game engines

  • unreal engine 4.22 ~ latest version

  • unity 5 ~ latest version

Programming platforms

  • iOS,Android,Windows,Macos

  • any .net environment

Details

Sample projects

Technical Support

QQ group:942696334

UE4-only QQ group:689643903