How to make variables read-only or hidden, based on other variables.
Sometimes you want to make some properties only available for editing if the object is a certain type.
Imagine we have a farming game, and we let game designers create plant definitions. We add a property FlowerColor, but we want to make it clear that this is only used if the plant has flowers.
Basic Example
We can use the meta flag meta=(EditCondition="bHasFlowers") to make this property only editable if the bHasFlowers value is true.
Similarly, we can make properties that are only available if a variable is false with the exclamation-mark prefix. For example meta=(EditCondition="!bHasFlowers").
It's also possible to use enums for edit conditions meta=(EditCondition="ToolType == EToolTypes::Wheelbarrow").
Advanced Example using CanEditChange
In the example above we saw a way of making a property read-only with a boolean variable. But what can we do for more advanced conditions?
We can do this with the CanEditChange function, which allows us to write any kind of conditions we want in C++.
Conditionally Hiding Options
Update: There's more!
There is another meta flag, EditConditionHides that you can use to hide properties rather than disabling them.
Below is kind of a contrived example, but the idea is that you can use EditConditionHides to hide stuff. As always search the source for more examples of how it's used.