In Unity, when SerializeField
is None
during scene execution, it will now output an error.
This prevents SerializeField
from unintentionally becoming None
.
- Adding the
Optional
attribute will exclude thatSerializeField
from error checking.
[SerializeField, Optional] SomeBehaviour _someBehaviour;
- By specifying namespaces and assembly names in ProjectSettings, MonoBehaviours included in the specification will be excluded from error checking.
- Open the Package Manager
- Press [+▼] button and click Add package from git URL...
- Enter the following:
openupm add com.tanitaka-tech.optional-serialize-field
This library was created with reference to the following library: