Hi!
I’m trying to move the “preview” functionality from a separate window (which is created by clicking a button in my custom inspector) to the SceneView itself.
The problem is, that the class “Editor” has no Update() function to override. From what I’ve seen there is no function at all that gets called as frequent as I need it. This is bad since while doing the “preview” I have to calculate and update variables very often.
I thought about simply creating an invisible EditorWindow and using it’s Update() to do everything but maybe there is a more elegant solution.
On a sidenote - is there a way to manipulate the SceneCamera’s cullingMask so I only get to see the objects I like while doing the “preview”? (by code I mean)
Note this will call Update function only if you see the inspector:
If you want the function to be called also when you are not seeing the Inspector (e.g. you have selected another object) use this instead:
public class YourInspector : Editor
{
[InitializeOnLoadMethod]
public static void InitUpdate() { EditorApplication.update += Update; }
static void Update()
{
//your code here...
}
}