Manually Update/Redraw Scene View?

I have a GameObject whose gizmo is drawn differently depending on certain properties of the GameObject which are modified through a custom editor I've created for it. As it is now, if I modify one of the properties, the gizmo isn't redrawn until I click in the scene view. Is there any way to manually update the either the scene view or just the gizmo when one of the properties is modified?

SceneView.RepaintAll(); You can try this, it works for me.

You should use this code:

`if (GUI.changed) EditorUtility.SetDirty (target);`

For more details see the documentation "LookAtPointEditor.js"

I believe HandleUtility.Repaint does what you want.

You can use EditorUtility.SetDirty(target) to update handles. But, to avoid to mark the scene aways as unsaved, you must do a trick like this:

var int lastValue = someValue;

someValue = EditorGUILayout.IntField("Value", someValue);

if (someValue != lastValue) {

Recently I implemented a Spawn system that have a custom inspector. Here is the inspector in action:

First you need to set the Gameobject as dirty, then repaint.

GameObject targetGameObject;
SceneView.RepaintAll ();

This may also help other future readers:

I just ran into this same question today myself. To further clarify the situation:

I have a series of checkboxes in my inspector that set static variable values to determine which handles to display. My OnSceneGUI() function tests the values of these variables to determine whether it should draw each handle. Though I could confirm these values would update in my OnInspectorGUI() function, I could not confirm they were updating in OnSceneGUI().

In order to make the scene view redraw, I put a call to HandleUtility.Repaint() first thing in my OnSceneGUI() function. I don't know if this is correct or ideal, but it works. I'd be interested to know if there is another way we are supposed to be doing this so I don't force repaint at all times if it is not needed.

mbysky’ is correct with the most relevant answer to the question asked.
The correct solution is a single one liner.
Making the scene dirty has nothing to do with repainting the scene view as asked, and as I searched for; I desired the information.
Now that I have that answer, I’m using “UnityEditor.SceneView.RepaintAll();” as I don’t need to use the UnityEditor namespace in my script since it’s not an editor script, it’s simply a method called in my actor’s OnDrawGizmos() function, and I like to use OnDrawGizmosSelected().
I found out recently I can avoid using editor scripts in this way which has a tonne of benefits.
I’ve had my fair share of fun with editor scripts, too.