Quantcast
Viewing latest article 6
Browse Latest Browse All 18

Custom Editors for classes that derive from system.object

Is there a way to override Unity's editor / inspector for standard classes deriving from System.Object? It appears to only work on classes deriving from MonoBehaviour.

For example, below, I'd like to hide or show 'exponent' based on the type selected in the editor. Obviously it would still serialize both values, but this is for editor display (and more complex cases).

[System.Serializable]
public sealed class NormalizedCurve{


    public enum Type{Linear, Exponential}


    [SerializeField]
    Type type;

    [SerializeField]
    float exponent;

}

Viewing latest article 6
Browse Latest Browse All 18

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>