I have a script that has a serialized array of strings. I want my scriptable objects to have an array of bools in their inspector windows that is based on the size of the array of strings.
For example, if I create this array of strings…
“dog”
“cat”
“bird”
…then I want to be able to automatically see a serialized array of bools like this:
Yes, you can use OnValidate() that method will run when you change something in the inspector. You can add the bools in many different ways, but they will not have names associated with them. I did a quick look on that and there are several posts that may help you out, but the easiest way seems to be to make a serialized class that has a bool and a string.