这个是真的坑,搜了半天,还看了官方技术文档,我还天真的想是不是方法被弃用了,原来是这个SceneView 关闭了Gizmos。再点击一下这个图标即可。如下图。
You can see at code lines 81,I have worte the Debug.Log,but when I use the
Unity ,the Console hasn’t print anything.

So, actually you must to click this button.

When I clicked this button ,look, It’s work.And you can see the red line and Debug.log print the string.

