C++ 코드를 사용하여 게임플레이 요소를 프로그래밍할 때, 각 모듈은 다수의 C++ 클래스를 포함할 수 있습니다.

각 클래스는 새 Actor 또는 Object 에 대한 템플릿을 정의합니다. 클래스 헤더 파일 안에는 클래스, 클래스
[함수](programming-and-scripting/programming-language-implementation/cpp-in-unreal-engine/Functions)
, [프로퍼티](programming-and-scripting/programming-language-implementation/cpp-in-unreal-engine/Properties)
가 선언됩니다.
클래스는 [구조체](programming-and-scripting/programming-language-implementation/programming-with-cpp-in-unreal-engine/unreal-engine-ustructs)
도 포함할 수 있는데, 연관성이 있는 프로퍼티를 체계적으로 정리하여 조작하는 데 도움이 되는 데이터 구조체입니다. 구조체는 자체적으로도 정의 가능합니다.
[](programming-and-scripting/programming-language-implementation/cpp-in-unreal-engine/Interfaces)
로는 다른 클래스에서 추가적인 게임플레이 작동방식을 구현할 수 있습니다.
언리얼 엔진으로 프로그래밍할 때는, 표준 C++ 클래스, 함수, 변수를 가질 수 있습니다. 이들은 표준 C++ 문법으로 정의됩니다. 그러나 UCLASS()
, UFUNCTION()
, UPROPERTY()
매크로를
사용하여 언리얼 엔진에 새로운 클래스, 함수, 변수를 인식시킬 수 있습니다. 예를 들어 UPROPERTY()
매크로가 선행된 선언부의 변수는
엔진의 가비지 컬렉션 대상이 되며, 언리얼 에디터 안에서 표시 및 편집도 가능합니다. UINTERFACE()
와 USTRUCT()
매크로도 있으며, 각 매크로에 키워드를 사용하여
언리얼 엔진과 언리얼 에디터 안에서 클래스 의,
[함수](programming-and-scripting/programming-language-implementation/cpp-in-unreal-engine/Functions/Specifiers)
의, [프로퍼티](programming-and-scripting/programming-language-implementation/cpp-in-unreal-engine/Properties/Specifiers)
의,
인터페이스의, [구조체](programming-and-scripting/programming-language-implementation/cpp-in-unreal-engine/Structs/Specifiers)
의 작동방식을 지정할 수 있습니다.
위 매크로에 추가로, 블루프린트에 C++ 코드를 노출시키는 데 주로 사용되는 UPARAM() 매크로가 있습니다. UPARAM() 사용 예제를 확인하려면, 블루프린트에 게임플레이 요소 노출시키기 문서를 참고하시기 바랍니다.