- Home /
Editor window script only works when window is open?
Is there any way to keep an editor script working even if the window loses focus or is closed?
At the root of my question is a desire to create a script that does not require a window or a custom inspector. I'm trying to create custom mouse functionality that highlights an object on the scene as I mouse over it. I don't want to create a manager type object in the scene view and it shouldn't matter if the editor window is open or not. Is this possible?
Answer by Stradigos · Jan 05, 2015 at 02:34 AM
Never occurred to me to just not extend it from a base class. This works fine.
[InitializeOnLoad]
public class MySceneClass
{
static MySceneClass()
{
SceneView.onSceneGUIDelegate += Update;
}
public static void Update(SceneView view)
{
// stuff
}
}
Your answer
Follow this Question
Related Questions
How can i get the center of the entire editor window 0 Answers
SetReplacementShader in Editor Utility? 0 Answers
What is the best way to draw icons in Unity's Hierarchy window? 1 Answer
Editor window doesn't open 2 Answers
How do I code my own custom built blend tree node as seen in the Animation Controller Editor Window? 1 Answer