- Home /
The answer was using static methods
How to have an edit-mode script run in the background of the editor?
Hello, So I have utilized the EditorWindow class to make a series of Pop-ups for a unity tutorial. However, now I want to make a manager that is active in the background and controls the states of the the EditorWindow pop-ups and of the tutorial. The pop-up manager should not be visible to the user. Im very new to using editor windows and edit-mode code but I wanted to try this project out.
I thought for the pop-up manager if I just did "CreateInstance()" without doing the ".Show()" method it would run in the background invisible but it doesnt.
For a basic example, how would I get this style of code to run passively in the editor background. All it does is load in a scriptable object that has reference to all the PopUps in arrays so that the manager can get information from any pop-up and control where the tutorial is. I need an awake style method of a class to run in edit-mode without anything visible to the user.
private void Awake()
{
data = Resources.Load("Scripts/Editor/NewManager") as PopUpManagerData;
Hierarchy = data.Hierarchy;
Inspector = data.Inspector;
Scene = data.Scene;
Game = data.Game;
Build = data.Build;
}