You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
added `SetObjectPtrPropertyValue(void* PropertyValueAddress, TObjectPtr<UObject> Value)` this allows objects to be imported from text without resolving the object #preflight 640900fa8832f48a4dc62ee4 [CL 24567650 by joe pribele in ue5-main branch]
70 lines
1.7 KiB
C++
70 lines
1.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
#if WITH_LOW_LEVEL_TESTS
|
|
|
|
#include "UObject/Object.h"
|
|
#include "UObject/ObjectPtr.h"
|
|
|
|
//simple test class for testing TObjectPtr resolve behavior
|
|
class UObjectPtrTestClass : public UObject
|
|
{
|
|
DECLARE_CLASS_INTRINSIC(UObjectPtrTestClass, UObject, CLASS_MatchedSerializers, TEXT("/Script/CoreUObject"))
|
|
|
|
public:
|
|
|
|
};
|
|
|
|
//test class with typed reference to another class
|
|
class UObjectPtrTestClassWithRef : public UObject
|
|
{
|
|
DECLARE_CLASS_INTRINSIC(UObjectPtrTestClassWithRef, UObject, CLASS_MatchedSerializers, TEXT("/Script/CoreUObject"))
|
|
|
|
public:
|
|
TObjectPtr<UObjectPtrTestClass> ObjectPtr;
|
|
TObjectPtr<UObjectPtrTestClass> ObjectPtrNonNullable;
|
|
TArray<TObjectPtr<UObjectPtrTestClass>> ArrayObjPtr;
|
|
};
|
|
|
|
|
|
//test class with typed reference to another class
|
|
class UObjectWithClassProperty : public UObject
|
|
{
|
|
DECLARE_CLASS_INTRINSIC(UObjectWithClassProperty, UObject, CLASS_MatchedSerializers, TEXT("/Script/CoreUObject"))
|
|
|
|
public:
|
|
TObjectPtr<UClass> ClassPtr;
|
|
};
|
|
|
|
//test class with raw pointer
|
|
class UObjectWithRawProperty : public UObject
|
|
{
|
|
DECLARE_CLASS_INTRINSIC(UObjectWithRawProperty, UObject, CLASS_MatchedSerializers, TEXT("/Script/CoreUObject"))
|
|
|
|
public:
|
|
UObjectPtrTestClass* ObjectPtr;
|
|
UObjectPtrTestClass* ObjectPtrNonNullable;
|
|
};
|
|
|
|
|
|
//derived test class
|
|
class UObjectPtrDerrivedTestClass : public UObjectPtrTestClass
|
|
{
|
|
DECLARE_CLASS_INTRINSIC(UObjectPtrDerrivedTestClass, UObjectPtrTestClass, CLASS_MatchedSerializers, TEXT("/Script/CoreUObject"))
|
|
|
|
public:
|
|
|
|
};
|
|
|
|
|
|
//non lazy test class
|
|
class UObjectPtrNotLazyTestClass : public UObject
|
|
{
|
|
DECLARE_CLASS_INTRINSIC(UObjectPtrNotLazyTestClass, UObject, CLASS_MatchedSerializers, TEXT("/Script/CoreUObject"))
|
|
|
|
public:
|
|
|
|
};
|
|
|
|
|
|
#endif |