本文整理汇总了C++中UClass::Serialize方法的典型用法代码示例。如果您正苦于以下问题:C++ UClass::Serialize方法的具体用法?C++ UClass::Serialize怎么用?C++ UClass::Serialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UClass
的用法示例。
在下文中一共展示了UClass::Serialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleReferencedObject
/**
* Manually serializes the class and archetype for the specified object so that assets which are referenced
* through the object's class/archetype can be differentiated.
*/
void FFindAssetsArchive::HandleReferencedObject(UObject* Obj )
{
if ( CurrentReferenceGraph != NULL )
{
// here we allow recursion if the current depth is less-than-equal (as opposed to less-than) because the archetype and class are treated as transparent objects
// serialization of the class and object are controlled by the "show class refs" and "show default refs" buttons
if ( MaxRecursionDepth == 0 || CurrentDepth < MaxRecursionDepth )
{
// now change the current reference list to the one for this object
if ( bIncludeDefaultRefs == true )
{
UObject* ObjectArc = Obj->GetArchetype();
UObject* Key = bUseReverseReferenceGraph? ObjectArc: Obj;
UObject* Value = bUseReverseReferenceGraph? Obj: ObjectArc;
TSet<UObject*>* ReferencedAssets = GetAssetList(Key);
// @see the comment for the bIncludeScriptRefs block
ReferencedAssets->Add(Value);
UObject* PreviousObject = CurrentObject;
CurrentObject = ObjectArc;
if ( ObjectArc->HasAnyMarks(OBJECTMARK_TagExp) )
{
// temporarily disable serialization of the class, as we need to specially handle that as well
bool bSkipClassSerialization = ArIgnoreClassRef;
ArIgnoreClassRef = true;
ObjectArc->UnMark(OBJECTMARK_TagExp);
ObjectArc->Serialize(*this);
ArIgnoreClassRef = bSkipClassSerialization;
}
CurrentObject = PreviousObject;
}
if ( bIncludeScriptRefs == true )
{
UClass* ObjectClass = Obj->GetClass();
UObject* Key = bUseReverseReferenceGraph? ObjectClass: Obj;
UObject* Value = bUseReverseReferenceGraph? Obj: ObjectClass;
TSet<UObject*>* ReferencedAssets = GetAssetList(Key);
// we want to see assets referenced by this object's class, but classes don't have associated thumbnail rendering info
// so we'll need to serialize the class manually in order to get the object references encountered through the class to fal
// under the appropriate tree item
// serializing the class will result in serializing the class default object; but we need to do this manually (for the same reason
// that we do it for the class), so temporarily prevent the CDO from being serialized by this archive
ReferencedAssets->Add(Value);
UObject* PreviousObject = CurrentObject;
CurrentObject = ObjectClass;
if ( ObjectClass->HasAnyMarks(OBJECTMARK_TagExp) )
{
ObjectClass->UnMark(OBJECTMARK_TagExp);
ObjectClass->Serialize(*this);
}
CurrentObject = PreviousObject;
}
}
}
}