Question by
schnappischnap · Aug 29, 2016 at 10:33 PM ·
editor-scriptinggizmos
Gizmos only updating while hovering over scene or game view
I have a method in my editor script:
[DrawGizmo(GizmoType.Selected | GizmoType.Active)]
static void DrawGizmos(Orbit orbit, GizmoType gizmoType)
But it doesn't get called when I change a variable in the inspector, until I move my mouse over the game view and wait a second.
Is there an efficient way to make sure the method is called every time a variable is changed?
Thank you.
Comment
Answer by Cynikal · Aug 30, 2016 at 06:48 AM
It's most likely the "GizmoType.Selected" portion, as it only draws it if it's selected.
I would recommend using:
void OnDrawGizmos()
{
//Gizmo stuff in here.
}
Unfortunately OnDrawGizmos() is a $$anonymous$$onoBehaviour method, and can't be used in an editor script.