Repository navigation
en scripting api
中文 | English | Docs | Repository
This page lists the types and members currently available in the scripting manifest. The manifest file is Library/ScriptApi/ScriptApi.json, currently at schema version 2, and both C# and Lua bindings are generated from it.
Base class for engine objects.
| Member | Notes |
|---|---|
name |
Object name |
GetInstanceID() |
Instance ID |
Destroy(Object, delay = 0) |
Request destruction, optionally delayed by seconds |
Instantiate(GameObject) |
Clone an object hierarchy |
| Equality | Compares handles; a destroyed object compares as null |
Accessing an invalid or destroyed object raises a missing reference error. Do not cache and reuse destroyed objects.
| Member | Notes |
|---|---|
gameObject |
Host object |
transform |
Host Transform |
tag |
Host tag |
CompareTag(string) |
Tag comparison |
GetComponent<T>() |
Component on the same object |
Base class for script components.
| Member | Notes |
|---|---|
enabled |
Component's own enabled state |
isActiveAndEnabled |
Enabled and the host is active in the hierarchy |
| Member | Notes |
|---|---|
GameObject(string name = "New GameObject", string tag = "") |
Create an object |
name |
Read and write the name |
tag |
Read and write the tag |
layer |
Read and write the layer |
activeSelf |
Self activation state |
activeInHierarchy |
Hierarchy activation state |
transform |
Transform component |
SetActive(bool) |
Toggle activation |
AddComponent<T>() |
Add a component |
GetComponent<T>() |
Retrieve a component |
GameObject.Find(string) |
Find by name |
GameObject.FindWithTag(string) |
Find by tag |
CreatePrimitive(string type = "Cube") |
Create a primitive |
| Member | Notes |
|---|---|
position / rotation
|
World-space position and rotation |
localPosition / localRotation
|
Local-space position and rotation |
eulerAngles / localEulerAngles
|
Euler angle access |
localScale / lossyScale
|
Scale |
parent / root
|
Hierarchy relations |
forward / right / up
|
Direction vectors |
Translate(Vector3) |
Translation, self-relative by default |
Rotate(Vector3 eulerAngles) |
Rotation, self-relative by default |
LookAt(Vector3) / LookAt(Transform)
|
Aim at a target |
TransformPoint / InverseTransformPoint
|
Point space conversion |
TransformDirection / InverseTransformDirection
|
Direction space conversion |
Angles are in degrees, and Quaternion uses (x, y, z, w) components.
| Member | Notes |
|---|---|
fieldOfView |
Perspective field of view |
orthographic |
Whether projection is orthographic |
orthographicSize |
Orthographic size |
nearClipPlane / farClipPlane
|
Clip planes |
clearColor |
Clear color |
| Member | Notes |
|---|---|
color |
Color |
intensity |
Intensity |
range |
Influence range |
spotAngle |
Outer cone angle |
type |
Light type |
UI elements are addressed by name. Current script members:
| Member | Notes |
|---|---|
LoadDocumentScript(string) |
Load a UI document |
GetDocumentGeneration() |
Document generation |
GetElementHandle(string) |
Resolve an element handle by name |
GetElementText(h) / SetElementText(h, string)
|
Read and write text |
GetElementValue(h) / SetElementValue(h, float)
|
Read and write a numeric value |
GetElementChecked(h) / SetElementChecked(h, bool)
|
Read and write the checked state |
FocusElement(h) |
Set focus |
GetRenderModeValue() / SetRenderModeValue(uint)
|
Render mode |
GetWorldRenderPathValue() / SetWorldRenderPathValue(uint)
|
World-space render path |
GetSortOrderScript() / SetSortOrderScript(int)
|
Sort order |
GetSortLayer() / SetSortLayer(int)
|
Sort layer |
GetCameraId() / SetCameraId(uint64)
|
Associated camera |
GetDpiMatch() / SetDpiMatch(float)
|
DPI match |
GetPixelsPerUnit() / SetPixelsPerUnit(float)
|
Pixel density |
GetDepthTest() / SetDepthTest(bool)
|
Depth test |
GetDepthWrite() / SetDepthWrite(bool)
|
Depth write |
GetAlwaysOnTop() / SetAlwaysOnTop(bool)
|
Always-on-top display |
| Member | Notes |
|---|---|
deltaTime |
Affected by timeScale
|
unscaledDeltaTime |
Not affected by timeScale
|
time / unscaledTime
|
Accumulated time |
frameCount / fixedFrameCount
|
Frame counters |
timeScale |
Time scaling |
fixedDeltaTime |
Fixed step, default 0.02
|
maximumDeltaTime |
Maximum step per frame, default 0.1
|
Fixed updates run before regular updates.
| Member | Notes |
|---|---|
SceneManager.GetActiveScene() |
Active scene |
SceneManager.LoadScene(string path) |
Request a scene load |
Scene.name / path / buildIndex / isLoaded
|
Scene information |
Scene.IsValid() |
Whether the scene is loaded |
LoadScene is a synchronous single-active-scene request that switches after the current script frame ends.
| Member | Notes |
|---|---|
GetKey(KeyCode) / GetKeyDown / GetKeyUp
|
Keyboard |
GetMouseButton(int) / GetMouseButtonDown / GetMouseButtonUp
|
Mouse buttons |
mousePosition |
Mouse position |
mouseScrollDelta |
Scroll delta |
| Member | Notes |
|---|---|
Log / LogWarning / LogError
|
Write to the log |
LogException |
Record an exception |
Assert(bool, message) |
Report a failed assertion as an error |
Lua runtime errors enter script diagnostics and the editor Console. Lua scripts should use the language's own error to produce a locatable failure.
Vector2, Vector3, Vector4, Quaternion, Color, Rect, Vector2Int, Vector3Int, RectInt, Bounds, BoundsInt, Ray, and Mathf provide lowercase fields, constants, operators, and common functions.
-
Library/ScriptApi/ScriptApi.jsonis the merged API manifest at schema version2. - Per-module source manifests live at
*/Gen/ScriptApi.json. - Unsupported portable signatures are rejected at build time rather than silently skipped.
The manifest currently contains engine-side reflected types only. Cross-references between script-defined types, coroutines, asset loading, physics, and audio APIs are not included yet.
-
UI Overview for the full
UICanvasComponentsemantics. - Reflection and Serialization explains how the manifest is generated.
Nullus Engine
中文
- 认识 Nullus
- 安装与快速入门
- 使用编辑器
- 场景与对象
- Prefab 工作流
- 资产与内容管线
- 渲染、材质与光照
- 大场景与资源管理
- 游戏逻辑与脚本
- 用户界面
- 动画与角色
- 物理与交互
- 音频、特效与媒体
- AI 与联网
- 平台、构建与发布
- 扩展与引擎架构
- 调试、性能与质量
- 参考手册
- 示例与发展路线
English
- Getting to Know Nullus
- Install and Quick Start
- Using the Editor
- Scenes and Objects
- Prefab Workflow
- Assets and Content Pipeline
- Rendering, Materials, and Lighting
- Large Scenes and Resource Management
- Gameplay and Scripting
- User Interface
- Animation and Characters
- Physics and Interaction
- Audio, Visual Effects, and Media
- AI and Networking
- Platforms, Builds, and Releases
- Extending the Engine
- Debugging, Performance, and Quality
- Reference
- Examples and Roadmap