Click or drag to resize

WarningIfNullAttribute Class

Mark fields in a MonoBehaviour with this attribute to give a specific warning when the field is not set.
Inheritance Hierarchy
SystemObject
  SystemAttribute
    PropertyAttribute
      Gamelogic.ExtensionsWarningIfNullAttribute

Namespace:  Gamelogic.Extensions
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
[AttributeUsageAttribute(AttributeTargets.Field)]
public class WarningIfNullAttribute : PropertyAttribute

The WarningIfNullAttribute type exposes the following members.

Constructors
  NameDescription
Public methodWarningIfNullAttribute
Initializes a new instance of the WarningIfNullAttribute class.
Top
Properties
  NameDescription
Public propertyorder

Optional field to specify the order that multiple DecorationDrawers should be drawn in.

(Inherited from PropertyAttribute.)
Public propertyTypeId (Inherited from Attribute.)
Public propertyWarningMessage
Gets the warning message.
Top
Methods
  NameDescription
Public methodEquals (Inherited from Attribute.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Attribute.)
Public methodGetType (Inherited from Object.)
Public methodIsDefaultAttribute (Inherited from Attribute.)
Public methodMatch (Inherited from Attribute.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodThrowIfNull
Throws a NullReferenceException if the object is null.
(Defined by ObjectExtensions.)
Top
Explicit Interface Implementations
Examples
public class MyMonoBehaviour : MonoBehaviour
{
    [WarningIfNull("Assign the prefab")]
    public GameObject playerPrefab;

    //...
}
See Also