Skip to content

Instantly share code, notes, and snippets.

@Nrjwolf
Created August 12, 2020 08:18
Show Gist options
  • Save Nrjwolf/6979fa72739223c8a3a199ce08259827 to your computer and use it in GitHub Desktop.
Save Nrjwolf/6979fa72739223c8a3a199ce08259827 to your computer and use it in GitHub Desktop.
{
"Get/Set": {
"prefix": "Get/Set",
"body": [
"[SerializeField]",
"private $TYPE m_$NAME;",
"public $TYPE $NAME",
"{",
" get => m_$NAME;",
" set",
" {",
" m_$NAME = value;",
" }",
"}"
],
"description": "Getter/Setter"
},
"OnValidate": {
"prefix": "Validate",
"body": [
"#if UNITY_EDITOR",
"void OnValidate()",
"{",
" if (!gameObject.activeInHierarchy)",
" return;",
" $1",
"}",
"#endif"
],
"description": "OnValidate with dependent compilation"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment