Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

CustomEditor does not render inherited class properly

Discussion in 'Editor & General Support' started by roberto_sc, Nov 18, 2019.

  1. roberto_sc

    roberto_sc

    Joined:
    Dec 13, 2010
    Posts:
    138
    I created my own UI image component that inherits from UnityEngine.UI.Image.
    Now I want to create a CustomEditor for it, but first I'm trying to render the base UnityEngine.UI.Image inspector first. That's what I did:

    Code (CSharp):
    1.     [UnityEditor.CustomEditor(typeof(MyImage), true)]
    2.     public class MyImageEditor : UnityEditor.Editor {}
    I'm adding nothing to it. Nevertheless, it doesn't get rendered properly. For example, the conditionals on Type don't work: I've selected Simple for Type, but Fill Amount and other fields from Type = Filled get rendered.
     
  2. Madgvox

    Madgvox

    Joined:
    Apr 13, 2014
    Posts:
    846
    Make your class inherit from
    UnityEditor.UI.ImageEditor
    .
     
  3. roberto_sc

    roberto_sc

    Joined:
    Dec 13, 2010
    Posts:
    138
    geez... that was a very silly mistake :(:(:(
    Thank you!
     
unityunity