Files
UnrealEngine/Engine/Source/Programs/AutoRTFMTests/Private/MyAutoRTFMTestObject.cpp
2025-05-18 13:04:45 +08:00

23 lines
666 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "MyAutoRTFMTestObject.h"
UMyAutoRTFMTestObject::FConstructorCallback* UMyAutoRTFMTestObject::ConstructorCallback = nullptr;
UMyAutoRTFMTestObject::UMyAutoRTFMTestObject(const FObjectInitializer& ObjectInitializer /* = FObjectInitializer::Get() */) : Value(42)
{
UObject* const Obj = ObjectInitializer.GetObj();
UObject* const Outer = Obj->GetOuter();
if (Outer->IsA<UMyAutoRTFMTestObject>())
{
UMyAutoRTFMTestObject* const OuterAsType = static_cast<UMyAutoRTFMTestObject*>(Outer);
OuterAsType->Value += 13;
}
if (ConstructorCallback)
{
ConstructorCallback(ObjectInitializer, *this);
}
}