Closed FredTA closed 2 years ago
It is already possible. ConditionalField allows to use method to check the field.
ConditionalFieldAttribute(bool useMethod, string method, bool inverse = false)
so you need to set true in the first parameter and method name in the second
[ConditionalField(true, "IsBaseClass")]
public bool ShownInBaseClass;
protected bool IsBaseClass() => GetType() == typeof(MyBaseClass);
note the protected keyword. It might be marked public as well, but provate method would not be accessible for the ConditionalField in the child class
..I really need to update the docs 😁
Let's say I have a base class with some serializableField property, that gets inherited by the child class While the child class should have this property, I don't want this property to be visible in the inspector on this child class. It would be awesome if there could be a conditional field where the condition is
className == someClass
orclassName != someClass