// Copyright (c) Wojciech Figat. All rights reserved.
using System;
namespace FlaxEngine
{
///
/// Shows property/field in the editor only if the specified member has a given value. Can be used to hide properties based on other properties (also private properties). The given member has to be bool type. Multiple VisibleIf attributes can be added for additional conditions to be met.
///
///
[Serializable]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = true)]
public sealed class VisibleIfAttribute : Attribute
{
///
/// The member name.
///
public string MemberName;
///
/// True if invert member value when computing the visibility value.
///
public bool Invert;
private VisibleIfAttribute()
{
}
///
/// Initializes a new instance of the class.
///
/// The name of the field or property of the object. Must be a bool type.
/// True if invert member value when computing the visibility value.
public VisibleIfAttribute(string memberName, bool invert = false)
{
MemberName = memberName;
Invert = invert;
}
}
}