학습 목표

   class UObject
    {
    public:
        // 공유 가능한 오브젝트 (얕은 복사)
        UObject* ObjectA;
        UObject* ObjectB;

        // 공유 불가능한 서브 오브젝트 (깊은 복사 필요)
        UObject* SubObjectA;
        UObject* SubObjectB;

        virtual ~UObject() {}

        // 서브 오브젝트를 복제하는 함수 (하위 클래스에서 재정의 가능)
        virtual void DuplicateSubObjects()
        {
            if (SubObjectA)
                SubObjectA = SubObjectA->Duplicate();

            if (SubObjectB)
                SubObjectB = SubObjectB->Duplicate();
        }

        // 현재 오브젝트를 복제하는 함수
        virtual UObject* Duplicate()
        {
            // 새 객체 생성
            UObject* NewObject = new UObject(*this); // 얕은 복사 수행

            // 서브 오브젝트는 깊은 복사로 별도 처리
            NewObject->DuplicateSubObjects();

            return NewObject;
        }
    };

    class UEditorEngine : public UObject
    {
        TArray<FWorldContext> WorldContexts;

        virtual void Tick(float DeltaSeconds);
    };

    void UEditorEngine::Tick(float DeltaSeconds)
    {
        // Editor 전용 액터 Tick 처리
        for (FWorldContext& WorldContext : WorldContexts)
        {
            UWorld* EditorWorld = WorldContext.World();
            if (EditorWorld && EditorWorld->WorldType == EWorldType::Editor)
            {
                ULevel* Level = EditorWorld->Level;
                {
                    for (AActor* Actor : Level->Actors)
                    {
                        if (Actor && Actor->bTickInEditor)
                        {
                            Actor->Tick(DeltaSeconds);
                        }
                    }
                }
            }
            else if (EditorWorld && EditorWorld->WorldType == EWorldType::PIE)
            {
                ULevel* Level = EditorWorld->Level;
                {
                    for (AActor* Actor : Level->Actors)
                    {
                        if (Actor)
                        {
                            Actor->Tick(DeltaSeconds);
                        }
                    }
                }
            }
        }
    }

    void StartPIE()
    {
        UWorld* EditorWorld = GEditor->GetEditorWorldContext().World();

        UWorld* PIEWorld = UWorld::DuplicateWorldForPIE(EditorWorld, ...);

        GWorld = PIEWorld;

            // AActor::BeginPlay()
        PIEWorld->InitializeActorsForPlay();
    }

    void EndPIE()
    {
        if (GWorld && GWorld->IsPIEWorld())
        {
            GWorld->CleanupWorld();
            delete GWorld;
        }

        GWorld = GEditor->GetEditorWorldContext().World();
    }
UE에 BillboardComponent를 참고하세요.

맴버 변수 Sprite에 Drop List UI를 통해 선택한 UTexture를 Assign 한다.

UE엔진에서 아래 이미지들을 가져와 Editor\Icon 폴더에 복사 합니다.

SpotLight_64x.png, PointLight_64x.png, Pawn_64x.png

Engine Core (눈에 안 보이는 세상)

핵심 키워드