diff --git a/Plugins/UnLua/Source/UnLua/Private/ReflectionUtils/PropertyDesc.cpp b/Plugins/UnLua/Source/UnLua/Private/ReflectionUtils/PropertyDesc.cpp index 4ed09930..a762b8f7 100644 --- a/Plugins/UnLua/Source/UnLua/Private/ReflectionUtils/PropertyDesc.cpp +++ b/Plugins/UnLua/Source/UnLua/Private/ReflectionUtils/PropertyDesc.cpp @@ -416,7 +416,7 @@ class FSoftObjectPropertyDesc : public FPropertyDesc { public: explicit FSoftObjectPropertyDesc(FProperty* InProperty) - : FPropertyDesc(InProperty) + : FPropertyDesc(InProperty), bFirstPropOfScriptStruct(GetPropertyOuter(Property)->IsA() && Property->GetOffset_ForInternal() == 0) { } @@ -463,7 +463,7 @@ class FSoftObjectPropertyDesc : public FPropertyDesc } else { - UnLua::PushPointer(L, (void*)ValuePtr, "FSoftObjectPtr", false); + UnLua::PushPointer(L, (void*)ValuePtr, "FSoftObjectPtr", bFirstPropOfScriptStruct); } } } @@ -525,6 +525,9 @@ class FSoftObjectPropertyDesc : public FPropertyDesc return true; }; #endif + +protected: + bool bFirstPropOfScriptStruct; }; /**