太菜了
起因:
- Gizmos.DrawLine、Debug.DrawLine无法在运行时看到。
- 搜索runTimeGizmos,推送了运行时显示控制物体,顺便也看看
- 运行时如何显示XYZ轴,及移动、缩放、旋转、撤销等功能。
- 说白了跟Unity编辑中一样。
解决思路:
- AssetStore搜索,有——花钱。
- GitHub搜索,有——真香
- 试试看Gizmos内部,TM这又是什么
效果:
链接:
可运行:https://github.com/HiddenMonk/Unity3DRuntimeTransformGizmo
多少报错跑不起来:https://github.com/Unity-Technologies/giles
还没试:https://github.com/popcron/gizmos
底层:
简单看了一下,如何显示出来?
有的用GL第一个,在TransformGizmo.cs行189
Unity官方用得动态创建mesh,在pb_HandleMesh.cs,pb_SceneEditor.cs行95