https://github.com/k8w/cocos-custom-gizmo-example
Custom gizmo example for cocos 3.6
https://github.com/k8w/cocos-custom-gizmo-example
Last synced: 25 days ago
JSON representation
Custom gizmo example for cocos 3.6
- Host: GitHub
- URL: https://github.com/k8w/cocos-custom-gizmo-example
- Owner: k8w
- License: mit
- Created: 2022-09-04T16:15:31.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-05T17:14:54.000Z (about 3 years ago)
- Last Synced: 2025-08-31T22:07:13.772Z (about 1 month ago)
- Language: TypeScript
- Size: 218 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Cocos 3.6 自定义 Gizmo 和 Editor 物件
===## 效果预览
1. Prefab:(包含多个子节点和自定义 GIZMO)

2. 场景编辑:(看不见 Prefab 细节,防止误修改)

3. 构建和实际运行:(剔除自定义 GIZMO)

## 工作流程
1. 在 Scene 中,像往常一样制作 Prefab
2. 保存为 Prefab 前,在最外层套一个空 Node,挂载 `CustomEditorItem`
3. 开启 `editing`,可以往 `__GIZMO__` 中添加自定义的 GIZMO;可以拖入 `SpriteGizmo`,也可以使用自定义模型。
4. 关闭 `editing`,保存 Prefab。> 提示
> `__GIZMO__` 及其资源不会显示和打包到版本中,可以放心使用。## 注意事项
1. `CustomEditorItem` 必须挂载在【顶层空节点】
2. 在 Scene 中不可开启 `editing`,除非断开所有 `Prefab` 连接,否则可能出现奇奇怪怪的问题。