Unity Editor package that converts C# components to TypeScript starter code for Needle Engine — a web-based 3D engine that brings Unity workflows to the browser using three.js under the hood.
This is not a full automatic conversion — it generates a starting point for porting existing C# Unity projects to Needle Engine.
Learn more about Needle Engine at needle.tools or check the documentation.
- Converts C# classes, structs, and enums to TypeScript
- Maps Unity types to Needle Engine equivalents (e.g.
Vector3,Transform,Animator) - Generates fields, properties, and method stubs
- Supports nullable types, field initializers, delegates, generics, and abstract classes
- Preserves XML doc comments and
@serializeable()decorators - Handles
HideInInspectorvia@nonSerialized()attribute
- Unity 2021.3+
- Needle Engine Exporter 4.15.0+
Install via Needle Installer or add manually via Unity Package Manager using the package name and registry:
com.needle.csharp-to-typescript
Registry: https://packages.needle.tools
- Right-click a C# script in the Unity Project window
- Select the conversion option from the context menu
- Review and adjust the generated TypeScript
dotnet restore tests/Needle.Engine.TypescriptCodegen.Tests.csproj
dotnet build tests/Needle.Engine.TypescriptCodegen.Tests.csproj --no-restore
dotnet test tests/Needle.Engine.TypescriptCodegen.Tests.csproj --no-buildPush to the release/package branch. The CI pipeline runs tests first, then publishes to the package registry.
package/ Unity package (Editor scripts + codegen logic)
Editor/
CodeBuilder/ Builders for classes, fields, methods, enums
CodeWriter/ Code output writers
Utils/ Type mapping and string utilities
tests/ C# unit tests
projects/ Sample Unity projects