Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 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 /
avatar image
0
Question by Filip-Zelinka · Sep 20, 2017 at 11:46 AM · editorflickeringglitchingobjectfield

Sprite objectfield flickers in custom inspector editor.

Hi, I got this annoying issue with editor. I got Custom Inspector Editor for simple ScriptableObject. And Sprite Object fields keep flickering, hiding and showing selected sprite and showing blue selection rectangles instead. Anyone has any idea how can this be prevented from happening? Thanks.

alt text

ScriptableObject:

 [CreateAssetMenu(fileName = "LevelRoster", menuName = "Picross/LevelRoster", order = 2)]
 public class LevelRoster : ScriptableObject
 {
     [System.Serializable]
     public class ChapterRoster
     {
         public Sprite chapterIcon;
         public Sprite level1Icon;
         public Sprite level2Icon;
         public Sprite level3Icon;
         public Sprite level4Icon;
         public Sprite level5Icon;
     }
 
     public List<ChapterRoster> chapters;
 
     public LevelRoster()
     {
 
     }
 
 }

Editor:

 [CustomEditor(typeof(LevelRoster))]
 public class LevelRosterEditor : Editor
 {
     public override void OnInspectorGUI()
     {
         LevelRoster levels = (LevelRoster)target;
         int index = 1;
         foreach (LevelRoster.ChapterRoster chapter in levels.chapters)
         {
             EditorGUILayout.BeginHorizontal();
             EditorGUILayout.BeginHorizontal();
             chapter.chapterIcon = this.addSpriteField(chapter.chapterIcon,"CH"+index+":");
             EditorGUILayout.EndHorizontal();
             EditorGUILayout.BeginHorizontal();
             chapter.level1Icon = this.addSpriteField(chapter.level1Icon,"1:");
             EditorGUILayout.EndHorizontal();
             EditorGUILayout.BeginHorizontal();
             chapter.level2Icon = this.addSpriteField(chapter.level2Icon,"2:");
             EditorGUILayout.EndHorizontal();
             EditorGUILayout.BeginHorizontal();
             chapter.level3Icon = this.addSpriteField(chapter.level3Icon,"3:");
             EditorGUILayout.EndHorizontal();
             EditorGUILayout.BeginHorizontal();
             chapter.level4Icon = this.addSpriteField(chapter.level4Icon,"4:");
             EditorGUILayout.EndHorizontal();
             EditorGUILayout.BeginHorizontal();
             chapter.level5Icon = this.addSpriteField(chapter.level5Icon,"5:");
             EditorGUILayout.EndHorizontal();
             EditorGUILayout.EndHorizontal();
             index++;
         }
         if (GUI.changed)
             EditorUtility.SetDirty(target);
     }
     private Sprite addSpriteField(Sprite sprite,string label)
     {
         EditorGUILayout.LabelField(label, GUILayout.Width(50));
         return (Sprite)EditorGUILayout.ObjectField(GUIContent.none, sprite, typeof(Sprite), allowSceneObjects: false, options:GUILayout.Width(55));
     }
 }


flickering.png (91.0 kB)
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

· Add your reply
  • Sort: 
avatar image
0

Answer by b1ackbird · Dec 05, 2019 at 04:17 PM

anyone solved this?

Comment
Add comment · Show 1 · 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 Artifact-Jesse · Apr 03, 2020 at 03:10 AM 0
Share

Fairly old thread, but it's not happening to me in 2019.3.3f1 DX11

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

137 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 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

Why does this keep happening? 0 Answers

Player Character glitching 0 Answers

Thin black lines between meshes 1 Answer

Unity editor - Keep columns narrow 0 Answers

Crash when reimporting custom assets 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