From b1a9396e64be1c854b8106092a23373d2459eed9 Mon Sep 17 00:00:00 2001 From: master Date: Sat, 5 Aug 2023 22:16:00 +0900 Subject: [PATCH] commit --- Source/UnrealCPP/MyCustomObject.cpp | 5 +++++ Source/UnrealCPP/MyCustomObject.h | 20 ++++++++++++++++++++ UnrealCPP.uproject | 3 ++- 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 Source/UnrealCPP/MyCustomObject.cpp create mode 100644 Source/UnrealCPP/MyCustomObject.h diff --git a/Source/UnrealCPP/MyCustomObject.cpp b/Source/UnrealCPP/MyCustomObject.cpp new file mode 100644 index 0000000..9cfca71 --- /dev/null +++ b/Source/UnrealCPP/MyCustomObject.cpp @@ -0,0 +1,5 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "MyCustomObject.h" + diff --git a/Source/UnrealCPP/MyCustomObject.h b/Source/UnrealCPP/MyCustomObject.h new file mode 100644 index 0000000..3119a4c --- /dev/null +++ b/Source/UnrealCPP/MyCustomObject.h @@ -0,0 +1,20 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "UObject/NoExportTypes.h" +#include "MyCustomObject.generated.h" +// generated.h 파일은 엔진에서 클래스 생성시 자동으로 생성되는 파일이다. Unreal C++은 기존 표준 C++에서 사용할 수 없는 C#이나 자바 처럼 고수준 언어에서 사용하는 +// 리플렉션 시스템, 메모리관리등 유용한 기능들을 사용하기위해 Unreal 에서 자동으로 생성시켜준다 생각하면 됨 +// 빌드시 UHT(Unreal Header Tool) 에서 해당 파일을 생성해준다. 경로는 Intermediate/Build/MyOS/UnrealEditor/Inc/ProjectName/UHT 에 있다. + +/** + * + */ +UCLASS() // Unreal Object가 선언된걸 명시하는 UCLASS 지정 +// _API = 클래스와 함수를 다른 모듈에 노출하도록 사용 됨 노출을 원하지 않을땐 지울수도 있다. / MyProjectName_API MyClassName = 노출 O, MyClassName = 노출 X +class UNREALCPP_API UMyCustomObject : public UObject +{ + GENERATED_BODY() // .generated.h 파일에서 본문이 있으며 현재 18번째 라인에 본문을 넣어준다 생각하면된다. +}; diff --git a/UnrealCPP.uproject b/UnrealCPP.uproject index b93841f..2fc1fd1 100644 --- a/UnrealCPP.uproject +++ b/UnrealCPP.uproject @@ -9,7 +9,8 @@ "Type": "Runtime", "LoadingPhase": "Default", "AdditionalDependencies": [ - "Engine" + "Engine", + "CoreUObject" ] } ],