本文整理汇总了C++中UPackage::GetFName方法的典型用法代码示例。如果您正苦于以下问题:C++ UPackage::GetFName方法的具体用法?C++ UPackage::GetFName怎么用?C++ UPackage::GetFName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UPackage
的用法示例。
在下文中一共展示了UPackage::GetFName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnAssetLoaded
void FChunkManifestGenerator::OnAssetLoaded(UObject* Asset)
{
if (Asset != NULL)
{
UPackage* AssetPackage = CastChecked<UPackage>(Asset->GetOutermost());
if (!AssetsLoadedWithLastPackage.Contains(AssetPackage->GetFName()))
{
AssetsLoadedWithLastPackage.Add(AssetPackage->GetFName());
}
}
}
示例2: OnLevelPostLoad
void UWorldComposition::OnLevelPostLoad(ULevel* InLevel)
{
UPackage* LevelPackage = Cast<UPackage>(InLevel->GetOutermost());
if (LevelPackage && InLevel->OwningWorld)
{
FWorldTileInfo Info;
UWorld* World = InLevel->OwningWorld;
if (World->WorldComposition)
{
// Assign WorldLevelInfo previously loaded by world composition
FWorldCompositionTile* Tile = World->WorldComposition->FindTileByName(LevelPackage->GetFName());
if (Tile)
{
Info = Tile->Info;
}
}
else
{
#if WITH_EDITOR
// Preserve FWorldTileInfo in case sub-level was loaded in the editor outside of world composition
FString PackageFilename = FPackageName::LongPackageNameToFilename(LevelPackage->GetName(), FPackageName::GetMapPackageExtension());
FWorldTileInfo::Read(PackageFilename, Info);
#endif //WITH_EDITOR
}
const bool bIsDefault = (Info == FWorldTileInfo());
if (!bIsDefault)
{
LevelPackage->WorldTileInfo = new FWorldTileInfo(Info);
}
}
}
示例3: GetSourceLink
TSharedPtr<SWidget> Get(const FActorTreeItem& ActorItem) const override
{
if (AActor* Actor = ActorItem.Actor.Get())
{
if (UClass* ActorClass = Actor->GetClass())
{
// Always show blueprints
const bool bIsBlueprintClass = UBlueprint::GetBlueprintFromClass(ActorClass) != nullptr;
// Also show game or game plugin native classes (but not engine classes as that makes the scene outliner pretty noisy)
bool bIsGameClass = false;
if (!bIsBlueprintClass)
{
UPackage* Package = ActorClass->GetOutermost();
const FString ModuleName = FPackageName::GetShortName(Package->GetFName());
FModuleStatus PackageModuleStatus;
if (FModuleManager::Get().QueryModule(*ModuleName, /*out*/ PackageModuleStatus))
{
bIsGameClass = PackageModuleStatus.bIsGameModule;
}
}
if (bIsBlueprintClass || bIsGameClass)
{
return FEditorClassUtils::GetSourceLink(ActorClass, Actor);
}
}
}
return nullptr;
}
示例4: DetectReadOnlyPackages
void FAssetFixUpRedirectors::DetectReadOnlyPackages(TArray<FRedirectorRefs>& RedirectorsToFix, TArray<UPackage*>& InOutReferencingPackagesToSave) const
{
// For each valid package...
for ( int32 PackageIdx = InOutReferencingPackagesToSave.Num() - 1; PackageIdx >= 0; --PackageIdx )
{
UPackage* Package = InOutReferencingPackagesToSave[PackageIdx];
if ( Package )
{
// Find the package filename
FString Filename;
if ( FPackageName::DoesPackageExist(Package->GetName(), NULL, &Filename) )
{
// If the file is read only
if ( IFileManager::Get().IsReadOnly(*Filename) )
{
FName PackageName = Package->GetFName();
// Find all assets that were referenced by this package to create a redirector when named
for ( auto RedirectorIt = RedirectorsToFix.CreateIterator(); RedirectorIt; ++RedirectorIt )
{
FRedirectorRefs& RedirectorRefs = *RedirectorIt;
if ( RedirectorRefs.ReferencingPackageNames.Contains(PackageName) )
{
RedirectorRefs.FailureReason = FText::Format(LOCTEXT("RedirectorFixupFailed_ReadOnly", "Referencing package {0} was read-only"), FText::FromName(PackageName));
RedirectorRefs.bRedirectorValidForFixup = false;
}
}
// Remove the package from the save list
InOutReferencingPackagesToSave.RemoveAt(PackageIdx);
}
}
}
}
}