Closed mikkelens closed 9 months ago
Hi! For it to work you'll have to make the velocity
protected
rather than private
.
Ah. I wasn't aware that could affect attributes. Can private protected
work too?
I think it shoud, but you can test, of course. The property must be accessible from the child (via reflection) to get any attributes. Otherwise Type.GetField
will return null. I could, conceivably, step up the hierarchy from the type upwards and accumulate the attributes from the parent. But I'm not sure it is really necessary.
This is my code in my base class (deriving from MonoBehaviour, which I have made a custom editor for like installation guide says):
I'm trying to use the ReadOnly attribute on a field like shown above.
It looks fine in the base class ("Physical Box")...![image](https://user-images.githubusercontent.com/31762830/202970253-7b24be4c-e521-4b93-ba4b-f4bbb042badd.png)
...but not in a derived class ("Player").
("Grounded" below is using a custom property drawer, ignore it)
I tried looking for any mention of this in the readme, but I didn't see it. Sorry if this is something that isn't intended to be possible.