本文整理汇总了C++中UPackage::SetPackageFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ UPackage::SetPackageFlags方法的具体用法?C++ UPackage::SetPackageFlags怎么用?C++ UPackage::SetPackageFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UPackage
的用法示例。
在下文中一共展示了UPackage::SetPackageFlags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ErrorText
//.........这里部分代码省略.........
if (!FPackageName::TryConvertFilenameToLongPackageName(InLongPackageName, PackageName))
{
// try to recover from this instead of throwing, it seems recoverable just by doing this
FText ErrorText(LOCTEXT("PackageResolveFailed", "Can't resolve asset name"));
LogGetPackageLinkerError(Result, InLongPackageName, ErrorText, ErrorText, InOuter, LoadFlags);
return nullptr;
}
// Allow delegates to resolve this path
PackageName = FPackageName::GetDelegateResolvedPackagePath(PackageName);
UPackage* ExistingPackage = FindObject<UPackage>(nullptr, *PackageName);
if (ExistingPackage)
{
if (!ExistingPackage->GetOuter() && ExistingPackage->HasAnyPackageFlags(PKG_InMemoryOnly))
{
// This is a memory-only in package and so it has no linker and this is ok.
return nullptr;
}
}
// Verify that the file exists.
const bool DoesPackageExist = DoesPackageExistForGetPackageLinker(PackageName, CompatibleGuid, NewFilename);
if( !DoesPackageExist )
{
if (!FLinkerLoad::IsKnownMissingPackage(InLongPackageName))
{
FFormatNamedArguments Arguments;
Arguments.Add(TEXT("Filename"), FText::FromString(InLongPackageName));
// try to recover from this instead of throwing, it seems recoverable just by doing this
LogGetPackageLinkerError(Result, InLongPackageName, FText::Format(LOCTEXT("FileNotFound", "Can't find file '{Filename}'"), Arguments), LOCTEXT("FileNotFoundShort", "Can't find file"), InOuter, LoadFlags);
}
return nullptr;
}
// Create the package with the provided long package name.
UPackage* FilenamePkg = (ExistingPackage ? ExistingPackage : CreatePackage(nullptr, *PackageName));
if (FilenamePkg != ExistingPackage && (LoadFlags & LOAD_PackageForPIE))
{
FilenamePkg->SetPackageFlags(PKG_PlayInEditor);
}
// If no package specified, use package from file.
if (!InOuter)
{
if( !FilenamePkg )
{
FFormatNamedArguments Arguments;
Arguments.Add(TEXT("Filename"), FText::FromString(InLongPackageName));
LogGetPackageLinkerError(Result, InLongPackageName, FText::Format(LOCTEXT("FilenameToPackage", "Can't convert filename '{Filename}' to asset name"), Arguments), LOCTEXT("FilenameToPackageShort", "Can't convert filename to asset name"), InOuter, LoadFlags);
return nullptr;
}
InOuter = FilenamePkg;
Result = FLinkerLoad::FindExistingLinkerForPackage(InOuter);
}
else if (InOuter != FilenamePkg) //!!should be tested and validated in new UnrealEd
{
// Loading a new file into an existing package, so reset the loader.
//UE_LOG(LogLinker, Log, TEXT("New File, Existing Package (%s, %s)"), *InOuter->GetFullName(), *FilenamePkg->GetFullName() );
ResetLoaders( InOuter );
}
}
#if 0
// Make sure the package is accessible in the sandbox.
if( Sandbox && !Sandbox->SupportsPackage(InOuter) )
{
FFormatNamedArguments Arguments;
Arguments.Add(TEXT("AssetName"), FText::FromString(InOuter->GetName()));
LogGetPackageLinkerError(Result, InLongPackageName, FText::Format(LOCTEXT("Sandbox", "Asset '{AssetName}' is not accessible in this sandbox"), Arguments), LOCTEXT("SandboxShort", "Asset is not accessible in this sandbox"), InOuter, LoadFlags);
return nullptr;
}
#endif
// Create new linker.
if( !Result )
{
check(IsLoading());
// we will already have found the filename above
check(NewFilename.Len() > 0);
Result = FLinkerLoad::CreateLinker( InOuter, *NewFilename, LoadFlags );
}
// Verify compatibility.
if (Result && CompatibleGuid && Result->Summary.Guid != *CompatibleGuid)
{
FFormatNamedArguments Arguments;
Arguments.Add(TEXT("AssetName"), FText::FromString(InOuter->GetName()));
// This should never fire, because FindPackageFile should never return an incompatible file
LogGetPackageLinkerError(Result, InLongPackageName, FText::Format(LOCTEXT("PackageVersion", "Asset '{AssetName}' version mismatch"), Arguments), LOCTEXT("PackageVersionShort", "Asset version mismatch"), InOuter, LoadFlags);
return nullptr;
}
return Result;
}