Not Null
[NotNull] The attribute checks that the Object field is not null.
Support Types
| Type |
|---|
Object |
Parameters
| Parameter Name | Description | Arguments |
|---|---|---|
Format |
Custom message format | {name} |
Size |
Box message size. | None |
Examples
[NotNull]
public GameObject player;
[NotNull(Format = "{name} is required!")]
public GameObject player;
[NotNull(Size = MessageBoxSize.Inline)]
public GameObject player;
Note
Make sure that you have added ApexInspector namespace in your script, to get access to all attributes.
using ApexInspector;
Demo
using ApexInspector;
using UnityEngine;
public class ExampleComponent : MonoBehaviour
{
[NotNull(Format = "{name} is cannot be empty!", Size = MessageBoxSize.Small)]
public GameObject player;
}

Live demo