Click or drag to resize

HideFieldAttribute Class

Allows hiding / disabling of fields without writing fancy custom editors. Adapted from http://www.brechtos.com/hiding-or-disabling-inspector-properties-using-propertydrawers-within-unity-5/
Inheritance Hierarchy
SystemObject
  SystemAttribute
    PropertyAttribute
      DustProductions.CoreHideFieldAttribute

Namespace:  DustProductions.Core
Assembly:  DustProductions.Core (in DustProductions.Core.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class HideFieldAttribute : PropertyAttribute

The HideFieldAttribute type exposes the following members.

Constructors
  NameDescription
Public methodHideFieldAttribute(Boolean)
Simple constructor to just hide this, without evaluating anything
Public methodHideFieldAttribute(String)
Basic constructor
Public methodHideFieldAttribute(String, Boolean)
Constructor for not completely hiding the field
Public methodHideFieldAttribute(String, Int32)
Costructor for int evaluations
Public methodHideFieldAttribute(String, Single)
Constructor for float evaluations
Public methodHideFieldAttribute(String, String)
Constructor for string evaluations
Public methodHideFieldAttribute(String, Type)
Constructor for type evaluations
Public methodHideFieldAttribute(String, Boolean, Boolean)
Constructor for not completely hiding the field and inverting the evaluation
Public methodHideFieldAttribute(String, Int32, Boolean)
Constructor for int evaluations if the int is a bitmask
Public methodHideFieldAttribute(String, Single, Single)
Constructor for float evaluations with custom error
Public methodHideFieldAttribute(String, String, StringComparison)
Constructor for string evaluations with a custom comparison type
Top
Fields
  NameDescription
Public fieldAllowableFloatingPointError
The amount of error in either direction you will allow when comparing floats
Public fieldCompletelyHide
Whether or not you want to hide the field completely, or just make it not editable unless in debug mode in the inspector
Public fieldConditionalSourceField
The name of the field whose value will be evaluated into a true or false
Public fieldConditionalSourceField2
The name of a second field that can be used to evaluate into true or false, if desired
Public fieldDesiredFloat
The float value to compare against
Public fieldDesiredInt
The int value to compare against
Public fieldDesiredString
The string to compare against
Public fieldDesiredType
The type value to compare against
Public fieldIntIsBitmask
Whether or not to treat the int as a bitmask
Public fieldInverse
After performing all the evaluations, do you want to return the opposite?
Public fieldStringComparisonType
The comparison type for string compares
Top
See Also