- Home /
Question by
VrTechEx · Dec 08, 2019 at 06:10 PM ·
editor-scriptingeditor windowinitialize
A problem with EditorWindow when run a script on launch (InitializeOnLoad)
I've got this warning when I use [InitialzeOnLoad] and call a script on my EditorWindow
The editor layout could not be fully loaded, this can happen when the layout contains EditorWindows not available in this project UnityEditor.WindowLayout:LoadDefaultWindowPreferences() (at C:/buildslave/unity/build/Editor/Mono/GUI/WindowLayout.cs:40)
My Code is
static SettingUp()
{
Debug.Log("UNITY OPEN");
EditorApplication.update += OnEditor;
}
private static void OnEditor()
{
EditorApplication.update -= OnEditor;
SettingUp setup = CreateInstance<SettingUp>();
setup.dosomething();
}
The warning disappears when I commented out these two lines
private static void OnEditor()
{
EditorApplication.update -= OnEditor;
//SettingUp setup = CreateInstance<SettingUp>();
//setup.dosomething();
}
Any ideas? Please Help
Comment
Your answer
