Description
The PropertyName
property of the HideIfAttribute
class specifies the name of the property to be tested for conditional visibility. This property is used in conjunction with the Value
property to determine whether a particular property should be hidden in the editor based on the value of another property within the same class.
Usage
To use the PropertyName
property, assign it the name of the property you want to test against. This is typically used in the context of editor scripting to conditionally hide properties in the inspector based on the state of other properties.
Example
// Example usage of HideIfAttribute
public class MyComponent : Component
{
[HideIf("IsVisible", true)]
public string HiddenProperty { get; set; }
public bool IsVisible { get; set; }
}
// In this example, HiddenProperty will be hidden in the editor if IsVisible is true.