* 정의
Actor는 레벨에 배치될 수 있는 Camera, StaticMesh, PlayerStartLocation과 같은 객체를 의미한다. Actor는 이동, 회전, 스케일링을 지원하며 게임플레이 코드를 통해 생성되거나 파괴될 수 있다. 이러한 데이터는 Actor의 RootComponent에 존재한다. AActor 클래스는 모든 Actor들의 기본 클래스이다.
* 동작 방식
- 생성
특수화된 템플릿 버전의 SpawnActor()를 통해서 생성할 수 있다.
정확하게는 UWorld::SpawnActor() 함수를 통해 이루어지며 간단한 예시는 다음과 같다.
AMyActor* actor1 = (AMyActor*) GetWorld()->SpawnActor(AMyActor::StaticClass(), NAME_None, ¤tLocation);
자세한 사용 방법은 다음 문서에서 확인할 수 있다.
Spawning Actors
Methods of creating new instances of Actors in gameplay code.
docs.unrealengine.com
- 삭제
World Object는 Actor의 참조 리스트를 가지고 있기 때문에 일반적으로 가비지 컬렉트되지 않는다. Destroy() 라는 함수를 통해 명시적으로 삭제 가능하다. 이 함수를 Actor를 레벨에서 삭제하고 pending kill로 마킹함으로써 다음 가비지 컬렉션에 의해 처리될 수 있다.
- Component
https://create-new-worlds.tistory.com/137
[UnrealEngine] ActorComponent
* 정의 Component는 특별한 타입의 Object로 서브오브젝트로서 Actor에 부착될 수 있다. Actor 측면에서는 Component라는 특별한 타입의 Object들을 담고 있는 컨테이너라고 볼 수 있다. 여러 타입의 Component
create-new-worlds.tistory.com
- Tick
https://create-new-worlds.tistory.com/142
[UnrealEngine] Tick
* 정의 Tick은 특정 코드를 특정 시간 간격(매 프레임, 특정 간격 등) 마다 수행하는 것을 말하며, Actor는 Tick(), ActorComponent는 TickComponent()라는 함수를 통해 기본적으로 수행될 수 있다. Tick 순서(Act..
create-new-worlds.tistory.com
'게임 엔진 > Unreal Engine' 카테고리의 다른 글
| [UnrealEngine] 스마트 포인터(Smart Pointer) (0) | 2022.03.28 |
|---|---|
| [UnrealEngine] Actor 생명주기(Actor Lifecycle) (0) | 2022.03.28 |
| [UnrealEngine] Tick (0) | 2022.03.28 |
| [UnrealEngine] ActorComponent (0) | 2022.03.26 |
| [UnrealEngine] 기본 내용 (0) | 2022.03.23 |