Search Unity

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:
    144
    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:
    1,317
    Make your class inherit from
    UnityEditor.UI.ImageEditor
    .
     
  3. roberto_sc

    roberto_sc

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