I have a button that I can drag a GameObject into a slot and when the button is selected in the editor a line is drawn to the referenced gameobject to indicate their relationship. But the line is only drawn when I select the button and not the referenced gameobject since I does not have a connection to the button.
I want to draw a ray from the referenced gameobject to the button when I select the referenced gameobject.
So when I drag the gameobject into the GameObject slot of the button this event must trigger to put a component on the referenced gameobject to draw a line and when I remove the referenced gameobject from the slot this component should be removed.
not quite, I dont want to draw it all the time. The button draws a ray to the platform when the button is selected. But the when I pull the platform to the GameObject slot on the button, I want the platform to draw a ray to the button when the platform is selected.
Well the platform then needs a reference to the button for this to be possible. Naturally you don’t want to have to assign them both however, so I would just OnDrawGimzos to always draw an arrow to the platform, and use the gimzo display window to toggle this as needed.