Repository navigation
en scripting debugging
中文 | English | Docs | Repository
C# debugging runs against a local editor Play session by attaching to the running CoreCLR through a project-level debug workspace. The debugger does not enter Play on its own unless you pick a profile that includes Attach and Play.
- Generate or open the project workspace at
<Project>/Library/IDE/VisualStudio/Nullus.Project.sln. - Close all Visual Studio instances and install
Tools/Debug/VisualStudioExtension/Nullus.ScriptDebugger.vsixfrom the repository. - Restart Visual Studio and reopen the project-level solution.
The build/ solution at the repository root is for engine source only and is not the F5 workspace for project scripts.
The VSIX is an offline package: it does not depend on the system PATH and does not download NuGet packages or debugging components. Close Visual Studio before updating the VSIX, otherwise the components in use cannot be replaced.
The Visual Studio solution configuration decides which editor starts:
| Solution configuration | Editor that starts |
|---|---|
Debug|x64 |
App/Win64_Debug_Runtime_Shared/Editor.exe |
Release|x64 |
App/Win64_Release_Runtime_Shared/Editor.exe |
No separate Release profile is needed. These profiles read the current solution configuration:
| Profile | Behavior |
|---|---|
Nullus: C# Scripts |
Attach the C# debugger only and stay in edit mode |
Nullus: C# Attach and Play |
Enter Play after the CoreCLR attach succeeds |
Nullus: Editor + C# Mixed |
Attach both native and CoreCLR; requires engine source and matching PDBs |
After pressing F5, the VSIX reads the broker path from the project's Library/IDE/Nullus.Debug.json. The broker reuses an existing editor instance by project ID and validates the PID, start time, project, and executable; it only starts a new editor when no instance matches. This prevents two editors from writing to the same project.
Plain C# profiles do not enter Play automatically. Once attached, press Play in the editor and Awake, Start, and Update breakpoints hit.
Saving Assets/**/*.cs triggers an automatic Debug build:
- On success, the editor swaps to a new collectible assembly at a frame boundary and rebinds PDB breakpoints.
- On failure, the previous working assembly keeps running and errors appear in the Console.
During a hot reload, existing script instances only see the backend replacement wrapped in OnDisable and OnEnable. The engine does not synthesize Awake, Start, or OnDestroy.
Lua has an optional LuaPanda integration that requires building with NLS_ENABLE_LUAPANDA_DEBUGGING (off by default). Once enabled, the project file's lua_panda_debugging and lua_panda_port decide whether to connect and on which port.
Lua has no build step: saving a file takes effect the next time you enter Play or trigger a reload.
The VSIX writes its most recent launch to %TEMP%/Nullus.ScriptDebugger.log. A Release verification must show both:
configuration=Release
executable=...\Win64_Release_Runtime_Shared\Editor.exe
The current editor instance can be checked through <Project>/Library/IDE/EditorInstance.json for editorExecutable and processId. A stale record left by an abnormal exit is validated and cleaned up on the next broker call, so an old PID never starts a second editor.
Native mixed builds use Tools/BuildCleanEnvironment.cmd, which only cleans duplicated Path/PATH in the subprocess and does not modify the user environment. Without engine source or PDBs, choose Nullus: C# Scripts.
| Symptom | Check |
|---|---|
| Breakpoints do not hit | Whether a Play profile was selected and Play actually started |
| The wrong editor launched | Solution configuration versus EditorInstance.json
|
| Script edits have no effect | Console build errors; the previous assembly may still be running |
| Mixed debugging cannot attach | Matching engine PDBs and the environment cleanup entry point |
- Debugging and Testing covers engine-side debugging and tests.
- Scripting Overview returns to the scripting model.
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