当前位置: 首页>>代码示例>>C++>>正文


C++ UPackage::GetFName方法代码示例

本文整理汇总了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());
		}
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:11,代码来源:ChunkManifestGenerator.cpp

示例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);
		}
	}
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:33,代码来源:WorldComposition.cpp

示例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;
		}
开发者ID:Codermay,项目名称:Unreal4,代码行数:32,代码来源:SceneOutlinerActorInfoColumn.cpp

示例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);
				}
			}
		}
	}
}
开发者ID:PopCap,项目名称:GameIdea,代码行数:36,代码来源:AssetFixUpRedirectors.cpp


注:本文中的UPackage::GetFName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。