MonoBehaviour-OnValidate() - Unity スクリプトリファレンス

Editor-only function that Unity calls when the script is loaded or a value changes in the Inspector.