C# to TypeScript
Translate your C# knowledge to TypeScript for Needle Engine
Value Types vs Reference Types
C# - Value Types (Structs)
void MyCallerMethod() {
var position = new Vector3(0, 0, 0);
MyExampleVectorMethod(position);
Debug.Log("Position.x is " + position.x); // ✅ Still 0 (copy was modified)
}
void MyExampleVectorMethod(Vector3 position) {
position.x = 42; // Modifies the COPY, not the original
}var myVector = new Vector3(1, 1, 1);
var myOtherVector = myVector; // Creates a COPY
myOtherVector.x = 42;
// Logs: 1, 42 (two separate instances)
Debug.Log(myVector.x + ", " + myOtherVector.x);TypeScript - Reference Types (Objects)
Vector Math & Operators
C# - Operator Overloading
TypeScript - Method Calls
Common Vector Operations
Operation
Unity (C#)
Needle Engine (TypeScript)
Time & Delta Time
Unity Time
Needle Engine Time
Property Mapping
Unity (C#)
Needle Engine (TypeScript)
Description
Raycasting
Unity Physics.Raycast
Needle Engine Raycast
Input
Unity Input
Needle Engine Input
InputSystem Callbacks
Unity IPointerClickHandler
Needle Engine Pointer Events
Debug.Log
Unity Debug
JavaScript Console
Debug Gizmos
Unity Gizmos
Needle Engine Gizmos
Unity
Needle Engine
Useful Utility Methods
Common Unity Methods
Unity (C#)
Needle Engine (TypeScript)
Quick Reference Cheat Sheet
Task
Unity (C#)
Needle Engine (TypeScript)
What's Next?
Last updated