diff --git a/CHANGELOG.md b/CHANGELOG.md index 66dcd52..1e154b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to the "unrealsnippets" extension will be documented in this ## Changes +- 4/27/2024 + - Added ActorComponent (ue-actor-component-header, ue-actor-component-code) + - 4/26/2024 - Started adding Mass AI snippets - Fragment (mass-fragment) diff --git a/package.json b/package.json index 8a3e17a..d22ee7b 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "UnrealSnippets", "description": "", "publisher": "tenowg", - "version": "0.5.3", + "version": "0.6.0", "pricing": "Free", "engines": { "vscode": "^1.85.0" diff --git a/snippets/general-file.code-snippets b/snippets/general-file.code-snippets index 9c17823..63136f7 100644 --- a/snippets/general-file.code-snippets +++ b/snippets/general-file.code-snippets @@ -108,5 +108,62 @@ "body": [ "#include \"$TM_FILENAME_BASE.h\"", ] + }, + "Actor_Component_header": { + "prefix": "ue-actor-component-header", + "isFileTemplate": true, + "body": [ + "#pragma once", + "", + "#include \"CoreMinimal.h\"", + "#include \"Components/ActorComponent.h\"", + "#include \"$TM_FILENAME_BASE.generated.h\"", + "", + "UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )", + "class $0_API U$TM_FILENAME_BASE : public UActorComponent", + "{", + " GENERATED_BODY()", + "", + "public:", + " // Sets default values for this component's properties", + " U$TM_FILENAME_BASE();", + "", + "protected:", + " // Called when the game starts", + " virtual void BeginPlay() override;", + "", + "public:", + " // Called every frame", + " virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;", + "", + "};" + ] + }, + "Actor_Component_code": { + "prefix": "ue-actor-component-code", + "isFileTemplate": true, + "body": [ + "#include \"$TM_FILENAME_BASE.h\"", + "", + "// Sets default values for this component's properties", + "U$TM_FILENAME_BASE::U$TM_FILENAME_BASE()", + "{", + " // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features", + " // off to improve performance if you don't need them.", + " PrimaryComponentTick.bCanEverTick = true;", + "}", + "", + "// Called when the game starts", + "void U$TM_FILENAME_BASE::BeginPlay()", + "{", + " Super::BeginPlay();", + "}", + "", + "// Called every frame", + "void U$TM_FILENAME_BASE::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)", + "{", + " Super::TickComponent(DeltaTime, TickType, ThisTickFunction);", + "}" + ] } } \ No newline at end of file