How to draw gizmos in preview window

Hey. The problem is as follows. I am creating a preview window using the PreviewRenderUtility class. In this preview window, I need to draw the gizmos of the light source, as it is drawn in the Scene window of the editor. Is it possible to do this?

Or at least how to draw a line? The Debug.DrawLine () and Handles.DrawLine () methods draw a line in the scene window, not a preview. I tried to hang on the object, in the preview scene, a script with the OnDrawGizmosSelected () method and select the object through Selection.activeGameObject. An object is selected, but OnDrawGizmosSelected () is not called.

5318412--535014--Скриншот 27-12-2019 212319.jpg
5318412--535017--Скриншот 27-12-2019 212254.jpg

3 Likes

Same