Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
This question was closed Apr 23, 2017 at 02:49 PM by Vexintgames for the following reason:

The question is answered, right answer was accepted

avatar image
1
Question by Vexintgames · Apr 23, 2017 at 05:50 AM · editoreditor-scriptingeditorwindoweditorgui

My EditorWindow won't display properly, even when commented out.

Hey,

I recently made an editor script and it was working fine. I added a line of code that didn't work, so I removed it. Now, every time I open the editor window, it doesn't appear despite all of my Debug.Log()'s going off, no errors showing up in the console, and none of my try's being caught.

This small editor-window-esque bit shows up sometimes in the top left: https://gyazo.com/5cebcc959a395aa36c7f621766144db4

My code, despite it being sloppy right now and not useful:

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEditor;
 using System.Linq;
 
 public class ItemEditor : EditorWindow {
     [MenuItem("Durian Utilities/Item Editor")]
 
 
     public static void ShowWindow()
     {
         GetWindow(typeof(ItemEditor));
     }
     private void OnFocus() 
     {
         //initItems();
     }
     
     List<InventoryItem> items = new List<InventoryItem>();
    
     private void initItems ()
     {
         Debug.Log("Got this far");
         items = Resources.LoadAll<InventoryItem>("Items").ToList();
         int id = 0;
         foreach(InventoryItem item in items)
         {
             item.id = id;
             id++;
         }
         Debug.Log("And this far, too");
         Focus();
     }
 
     private void OnGUI()
     {
         Debug.Log("Made it to ONGUI");
         position = new Rect(new Vector2(-1920,0), new Vector2(500, 500));
         GUILayout.Label("Item Editor © Vextin 2027", EditorStyles.centeredGreyMiniLabel);
          //a bunch of stuff down here is commented out
          }
     }
 }


I guarantee that this isn't a script issue, but may as well give details.

I'm using Unity 5.6.0f3

So, does anyone know of a reason for this to not be working?

EDIT: I just made a separate script and it doesn't display its window either.

Relaunched Unity and got the errors

Removed empty DockArea while reading window layout: window #5, instanceID=11774 UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)

and

Error while reading window layout: window #1 is null UnityEditor.WindowLayout:LoadWindowLayout(String, Boolean)

None of my custom editors are loading, still.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Adam-Mechtley · Apr 23, 2017 at 01:45 PM 0
Share

The error message you're getting is because your window layout has serialized some window, but the Editor cannot find the type for it or had some other deserialization problem.

If this example you pasted is verbatim what is in your project, you have an extra closing brace right after //a bunch of stuff down here is commented out. If this is not a compiler error issue though, try resetting to the Default window layout (top right of the editor) and see if the problem goes away.

avatar image Vexintgames Adam-Mechtley · Apr 25, 2017 at 02:33 PM 0
Share

Solved. I'm really fucking confused.

I took your advice and ran with it. I reset the layout, which actually resulted in a bug that had me restart the unity editor but it was fine. I then checked class names. As it turns out, the other editors I made to see if it was a Unity-wide bug were still instantiating a window of the class ItemEditor so they weren't actually different at all. Finally, the position = new Rect(new Vector2(-1920,0), new Vector2(500, 500)); line, despite me tweaking the values to anywhere between (-1920, -1080) to (1920, 1080) and every conceivable place in between, were hiding the editor.

Thanks for your help!

avatar image felixmann · May 19, 2017 at 06:11 AM 0
Share

Got this error suddenly after upgrading to Unity 5.6.1 from 5.5.1 :/ Restarting Unity fixed the problem for me.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

120 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Editor Int sliders affecting each other 0 Answers

GUI.Window. Wanting to allow clickthrough 0 Answers

How to change the text of EditorGUILayout.TextField 2 Answers

How to Have a ReoderableList in a Custom Editor Window 1 Answer

Do Unity Editor GUI Utilities (Handles.DrawLine & EditorGUI.DrawRect) have limitations? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges