Skip to content

Latest commit

 

History

History
75 lines (60 loc) · 4.94 KB

README_EN.md

File metadata and controls

75 lines (60 loc) · 4.94 KB

license

[中文简体] | [English]

The current page is translated by a machine, information may be missing or inaccurate. If you encounter any problems or have questions, please submit an ISSUE.

  • If you are interested in this project, please click star to support.
  • If you have any ideas or questions, please submit feedback through [PR] and [ISSUES].
  • Note: The TsComponent and ThreadWorker modules in the current project have not been widely verified, and their functionality may have defects. If you encounter any issues during use, please provide feedback through [ISSUES].

Introduction

For more information, please refer to the [Documentation].

[2023/02/13] Please note that the latest version 1.0.0-rc.1 of webgl-support in OpenUMP does not support automatic appending of suffixes, waiting for subsequent updates.

Main features:

  • TsBehaviour:

    Use Unity MonoBehaviour lifecycle methods in TypeScript scripts.

    [Documentation]

  • TsProperties:

    A standalone serialization class used for saving data and attaching UnityEngine.Object objects.

    [Documentation]

  • TsComponent:

    Implementation that combines TsBehaviour and TsProperties, serializing member variables in ts scripts and using Unity lifecycle methods. It manages the lifecycle of ts objects. Allows UGUI events to be bound to ts scripts (UGUI events).

    [Documentation]

  • ThreadWorker:

    Provides cross-thread & cross-Puerts.JsEnv instance interaction (data transmission based on C# types).

    [Documentation]

Environment

Software or Package Version
Unity 2019.2.x +
puerts 1.4.0 +
nodejs unknown
OpenUPM Version
puerts 2.0.2
puerts-webgl-support 2.0.2
puerts-commonjs-support 2.0.1

Getting Started

  1. Download this template project.
  2. Go to the projects/TsProject directory and execute the npm install or yarn command to install dependencies.
  3. Execute the tsc command to compile the TypeScript project.
  4. Done.

Tools

  • ConsoleRedirect:

    Implement direct jumping to ts scripts by clicking/double-clicking hyperlinks in the Unity Console.

  • HotReload:

    C#-only js script hot update tool (requires v8 + inspect support), used for runtime modification of js logic for quick debugging.

  • MiniLinkXml:

    Analyze the typescript project, obtain all used C# types (support additional custom types), and generate a minimal link.xml configuration file.

  • ECMAScript:

    C# namespace generation tool, can quick import values and types (e.g., import { GameObject} from 'csharp.UnityEngine'). Make the project compatible with both commonjs and esm modules without additional code modifications.

Roadmap

  • None