• 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 /
This question was closed Nov 08, 2012 at 09:09 AM by AeonIxion for the following reason:

The question is answered, right answer was accepted

avatar image
4
Question by AeonIxion · Nov 08, 2012 at 09:02 AM · editorguilayout

EditorGUILayout, Multi-object editing not supported

Hi,

I have an editorscript, but in the inspector it says Multi-object editing not supported. I have no idea why I get this, because my other editorscript works fine.

here's the relevant code from my normal script:

 public enum WeatherState
     {
         Sunny,
         Rainy,
         Snowy        
     }
     
     [SerializeField]
     private WeatherState m_eState;
     
     public WeatherState State { get{return m_eState;} set{m_eState = value;}}

And here's the code from my editor script:

 using UnityEngine;
 using UnityEditor;
 using System.Collections;
 
 [CustomEditor(typeof(Weather))]
 public class Weather_Editor : Editor {
 
 
     public override void OnInspectorGUI()
     {
         var t = target as Weather;
         t.State = (Weather.WeatherState)EditorGUILayout.EnumPopup("Weather State", t.State);
 
         if(GUI.changed)
         {
             EditorUtility.SetDirty(t);    
         }        
     }
 }
Comment
Add comment
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

1 Reply

  • Sort: 
avatar image
19
Best Answer

Answer by AeonIxion · Nov 08, 2012 at 09:07 AM

nvm got it working..

I had my object in the Hierarchy selected, but didn't see I also had my script selected.

Comment
Add comment · Show 5 · Share
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 Reyan · Feb 22, 2013 at 10:51 PM 0
Share

Would you be able to explain your solution more clearly? I am having the same problem. Thanks

avatar image Bunny83 · Feb 23, 2013 at 12:06 AM 0
Share

@Reyan:
Just make sure you only select one object at a time. If you select multiple objects (by holding shift, using a rectangle selection, ...) you can't edit them together if they are of a different type.

Also the way this custom editor is designed it can only edit one object at a time. $$anonymous$$ulti editing has been added in Unity3.5 i think. To be able to use multi editing you have to use the SerializedObject and SerializedProperties in your editor.

Here is some general information on multi editing. See this page for how to implement multi editing in your custom inspectors

avatar image Reyan · Feb 23, 2013 at 03:51 PM 1
Share

Thanks for your comment Bunn83; as it turns out my problem in this case was that I didn't realize it was mandatory that you put the editors in a folder titled "Editor" ($$anonymous$$e was titled "Editors").

avatar image Fehr · Feb 26, 2014 at 01:55 AM 1
Share

If anyone else happens to come across this problem, I can't list it as an answer as this seems to be closed, but this can occur if your editor script (in the given example Weather_Editor) isn't in Assets/Editor.

avatar image pansapiens · Apr 04, 2014 at 11:32 AM 1
Share

This will also occur if you don't name the class and the filename the same thing (Weather_Class and Weather_Class.cs - else you'll see "Instance of Weather_EditorWithTypo couldn't be created because there is no script with that name." in the console).

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

13 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

Related Questions

serializedObject with EditorGUILayout.Popup in C# 1 Answer

EditorGUI, EditorGUILayout, GUI, GUILayout... pshhh... WHEN TO USE WHAT?! 3 Answers

Editor - GUILayout.BeginArea does not expand ScrollView 2 Answers

Player Settings messed up 1 Answer

Is there a way to change the text size for a Vector3 PropertyField in a custom Inspector? 0 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