From f8fa28a96919a7a3e6fe93ab84e8bde79a056639 Mon Sep 17 00:00:00 2001 From: ThatAmuzak Date: Wed, 4 Jun 2025 00:39:21 -0700 Subject: [PATCH] added sfield and requirecomponent snippets Sourced from https://github.com/kleber-swf/vscode-unity-code-snippets/blob/develop/snippets/snippets.json --- snippets/frameworks/unity.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/snippets/frameworks/unity.json b/snippets/frameworks/unity.json index a48a3da9..dd7eb185 100644 --- a/snippets/frameworks/unity.json +++ b/snippets/frameworks/unity.json @@ -717,5 +717,19 @@ "prefix": "interface", "description": "Creates a normal interface.", "body": ["public interface ${TM_FILENAME_BASE} {", "\t$0", "}"] + }, + "Attribute: SerializeField": { + "prefix": "sfield", + "body": [ + "[SerializeField] private $0;" + ], + "description": "Force Unity to serialize a private field." + }, + "MonoBehaviour RequireComponent": { + "prefix": "RequireComponent", + "body": [ + "[RequireComponent(typeof($0))]" + ], + "description": "Automatically adds required components as dependencies." } }