Hi there!
I want to draw lines between GameObject hierarchy items depending on selection. So, if I select a GameObject in a hierarchy in scene view, lines should be drawn from the root object to the child objects recursively.
I already made the drawing part using OnDrawGizmos() and Gizmos.DrawLine().
My problem is, that I don’t know how to tell my script which GameObject is currently selected. My script is attached to a GameObject in the scene, so I cannot use Selection.activeTransform since it’s editor class. On the other hand, I cannot use an editor script, because that way it’s not drawing anything with Gizmos.DrawLine().
Is there a way to send messages from an editor script to a normal script?
Any help or suggestions would be appreciated!