Class WarningIfNullAttribute
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
Mark fields in a MonoBehaviour with this attribute to give a specific warning when the field is not set.
[AttributeUsage(AttributeTargets.Field)]
[Obsolete("Use ValidateNotNullAttribute instead.")]
public class WarningIfNullAttribute : ValidateNotNullAttribute
- Inheritance
-
WarningIfNullAttribute
- Inherited Members
- Extension Methods
Examples
public class MyMonoBehaviour : MonoBehaviour
{
[WarningIfNull("Assign the prefab")]
public GameObject playerPrefab;
//...
}
Constructors
- WarningIfNullAttribute()
Initializes a new instance of the WarningIfNullAttribute class.
- WarningIfNullAttribute(string)
Initializes a new instance of the WarningIfNullAttribute class with a custom warning message.