I have a PropertyDrawer which draws a certain class as a button. When that button is pressed, I need to start capturing scene events (clicks in the scene, etc.) with OnSceneGUI, but it appears to be unsupported by PropertyDrawer. How come? What can I do to remedy?
You probably need to do something like make your PropertyDrawer enable/disable some static flag like MyPropertyType.IsInEditMode = true
which you would then test as necessary in your custom editor’s OnSceneGUI callback.
As far as I know class properties are not passed to the scene directly. Only entire MonoBehaviour go the scene. You would think that custom property drawers would also have a hook into the scene view, but probably no one has implemented it yet.
So you need to use a UnityEditor.Editor with CustomEditor(typeof(ClassUsingTheProperty)) to activate its OnSceneGUI and then start collecting events. This unfortunately means copy pasting code for every single class type that uses the property.