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


C++ FStringAssetReference::ToString方法代码示例

本文整理汇总了C++中FStringAssetReference::ToString方法的典型用法代码示例。如果您正苦于以下问题:C++ FStringAssetReference::ToString方法的具体用法?C++ FStringAssetReference::ToString怎么用?C++ FStringAssetReference::ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FStringAssetReference的用法示例。


在下文中一共展示了FStringAssetReference::ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PostInitProperties

void USoundBase::PostInitProperties()
{
	Super::PostInitProperties();

	if (USoundBase::DefaultSoundClassObject == nullptr)
	{
		const FStringAssetReference DefaultSoundClassName = GetDefault<UAudioSettings>()->DefaultSoundClassName;
		if (DefaultSoundClassName.IsValid())
		{
			USoundBase::DefaultSoundClassObject = LoadObject<USoundClass>(nullptr, *DefaultSoundClassName.ToString());
		}
	}
	SoundClassObject = USoundBase::DefaultSoundClassObject;

	if (USoundBase::DefaultSoundSubmixObject == nullptr)
	{
		const FStringAssetReference DefaultSoundSubmixName = GetDefault<UAudioSettings>()->DefaultSoundSubmixName;
		if (DefaultSoundSubmixName.IsValid())
		{
			USoundBase::DefaultSoundSubmixObject = LoadObject<USoundSubmix>(nullptr, *DefaultSoundSubmixName.ToString());
		}
	}
	SoundSubmixObject = USoundBase::DefaultSoundSubmixObject;

	if (USoundBase::DefaultSoundConcurrencyObject == nullptr)
	{
		const FStringAssetReference DefaultSoundConcurrencyName = GetDefault<UAudioSettings>()->DefaultSoundConcurrencyName;
		if (DefaultSoundConcurrencyName.IsValid())
		{
			USoundBase::DefaultSoundConcurrencyObject = LoadObject<USoundConcurrency>(nullptr, *DefaultSoundConcurrencyName.ToString());
		}
	}
	SoundConcurrencySettings = USoundBase::DefaultSoundConcurrencyObject;

}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:35,代码来源:SoundBase.cpp

示例2: StreamInternal

struct FStreamable* FStreamableManager::StreamInternal(FStringAssetReference const& InTargetName)
{
	check(IsInGameThread());
	UE_LOG(LogStreamableManager, Verbose, TEXT("Asynchronous load %s"), *InTargetName.ToString());

	if (FPackageName::IsShortPackageName(InTargetName.ToString()))
	{
		UE_LOG(LogStreamableManager, Error, TEXT("     Can't load invalid package name %s"), *InTargetName.ToString());
		return NULL;
	}

	FStringAssetReference TargetName = ResolveRedirects(InTargetName);
	FStreamable* Existing = StreamableItems.FindRef(TargetName);
	if (Existing)
	{
		if (Existing->bAsyncUnloadRequestOutstanding)
		{
			// It's valid to have a live pointer if an async loaded object was hard referenced later
			check(!Existing->bAsyncLoadRequestOutstanding); // we should not be both loading and unloading
			UE_LOG(LogStreamableManager, Verbose, TEXT("     Aborted unload for %s"), *TargetName.ToString());
			Existing->bAsyncUnloadRequestOutstanding = false;
			check(Existing->Target || Existing->bLoadFailed); // should not be an unload request unless the target is valid
			return Existing;
		}
		if (Existing->bAsyncLoadRequestOutstanding)
		{
			UE_LOG(LogStreamableManager, Verbose, TEXT("     Already in progress %s"), *TargetName.ToString());
			check(!Existing->bAsyncUnloadRequestOutstanding); // we should not be both loading and unloading
			check(!Existing->Target); // should not be an load request unless the target is invalid
			return Existing; // already have one in process
		}
		if (Existing->Target)
		{
			UE_LOG(LogStreamableManager, Verbose, TEXT("     Already Loaded %s"), *TargetName.ToString());
			return Existing; 
		}
	}
	else
	{
		Existing = StreamableItems.Add(TargetName, new FStreamable());
	}

	FindInMemory(TargetName, Existing);

	if (!Existing->Target)
	{
		FString Package = TargetName.ToString();
		int32 FirstDot = Package.Find(TEXT("."));
		if (FirstDot != INDEX_NONE)
		{
			Package = Package.Left(FirstDot);
		}

		Existing->bAsyncLoadRequestOutstanding = true;
		LoadPackageAsync(Package,
			FLoadPackageAsyncDelegate::CreateStatic(&AsyncLoadCallbackWrapper, new FCallback(TargetName, this))
			);
	}
	return Existing;
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:60,代码来源:StreamableManager.cpp

示例3: AsyncLoadCallback

void FStreamableManager::AsyncLoadCallback(FStringAssetReference Request)
{
	FStringAssetReference TargetName = Request;
	FStreamable* Existing = StreamableItems.FindRef(TargetName);

	UE_LOG(LogStreamableManager, Verbose, TEXT("Stream Complete callback %s"), *TargetName.ToString());
	if (!Existing)
	{
		// hmm, maybe it was redirected by a consolidate
		TargetName = ResolveRedirects(TargetName);
		Existing = StreamableItems.FindRef(TargetName);
	}
	if (Existing && Existing->bAsyncLoadRequestOutstanding)
	{
		Existing->bAsyncLoadRequestOutstanding = false;
		if (!Existing->Target)
		{
			FindInMemory(TargetName, Existing);
		}

		CheckCompletedRequests(Request, Existing);
	}
	if (Existing->Target)
	{
		UE_LOG(LogStreamableManager, Verbose, TEXT("    Found target %s"), *Existing->Target->GetFullName());
	}
	else
	{
		// Async load failed to find the object
		Existing->bLoadFailed = true;
		UE_LOG(LogStreamableManager, Verbose, TEXT("    Failed async load."), *TargetName.ToString());
	}
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:33,代码来源:StreamableManager.cpp

示例4: ExportTextItem

void UAssetObjectProperty::ExportTextItem( FString& ValueStr, const void* PropertyValue, const void* DefaultValue, UObject* Parent, int32 PortFlags, UObject* ExportRootScope ) const
{
	FAssetPtr& AssetPtr = *(FAssetPtr*)PropertyValue;

	FStringAssetReference ID;
	UObject *Object = AssetPtr.Get();

	if (Object)
	{
		// Use object in case name has changed.
		ID = FStringAssetReference(Object);
	}
	else
	{
		ID = AssetPtr.GetUniqueID();
	}

	if (0 != (PortFlags & PPF_ExportCpp))
	{
		ValueStr += FString::Printf(TEXT("FStringAssetReference(TEXT(\"%s\"))"), *ID.ToString().ReplaceCharWithEscapedChar());
		return;
	}

	if (!ID.ToString().IsEmpty())
	{
		ValueStr += ID.ToString();
	}
	else
	{
		ValueStr += TEXT("None");
	}
}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:32,代码来源:PropertyAssetObject.cpp

示例5: ExportTextItem

void UAssetObjectProperty::ExportTextItem( FString& ValueStr, const void* PropertyValue, const void* DefaultValue, UObject* Parent, int32 PortFlags, UObject* ExportRootScope ) const
{
    FAssetPtr& AssetPtr = *(FAssetPtr*)PropertyValue;

    FStringAssetReference ID;
    UObject *Object = AssetPtr.Get();

    if (Object)
    {
        // Use object in case name has changed.
        ID = FStringAssetReference(Object);
    }
    else
    {
        ID = AssetPtr.GetUniqueID();
    }

    if (!ID.ToString().IsEmpty())
    {
        ValueStr += ID.ToString();
    }
    else
    {
        ValueStr += TEXT("None");
    }
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:26,代码来源:PropertyAssetObject.cpp

示例6: GetStreamed

UObject* FStreamableManager::GetStreamed(FStringAssetReference const& InTargetName)
{
	check(IsInGameThread());
	FStringAssetReference TargetName = ResolveRedirects(InTargetName);
	FStreamable* Existing = StreamableItems.FindRef(TargetName);
	if (Existing && Existing->Target)
	{
		UE_LOG(LogStreamableManager, Verbose, TEXT("GetStreamed %s  -> %s"), *TargetName.ToString(), *Existing->Target->GetFullName());
		return Existing->Target;
	}
	UE_LOG(LogStreamableManager, Verbose, TEXT("GetStreamed %s  -> NULL"), *TargetName.ToString());
	return NULL;
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:13,代码来源:StreamableManager.cpp

示例7: IsAsyncLoadComplete

bool FStreamableManager::IsAsyncLoadComplete(FStringAssetReference const& InTargetName)
{
	check(IsInGameThread());
	FStringAssetReference TargetName = ResolveRedirects(InTargetName);
	FStreamable* Existing = StreamableItems.FindRef(TargetName);
	UE_LOG(LogStreamableManager, Verbose, TEXT("IsStreamComplete %s  -> %d"), *TargetName.ToString(), !Existing || !Existing->bAsyncLoadRequestOutstanding);
	return !Existing || !Existing->bAsyncLoadRequestOutstanding;
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:8,代码来源:StreamableManager.cpp

示例8: PostInitProperties

void USoundBase::PostInitProperties()
{
	Super::PostInitProperties();

	const FStringAssetReference DefaultSoundClassName = GetDefault<UAudioSettings>()->DefaultSoundClassName;
	if (DefaultSoundClassName.IsValid())
	{
		SoundClassObject = LoadObject<USoundClass>(NULL, *DefaultSoundClassName.ToString());
	}
}
开发者ID:stoneStyle,项目名称:Unreal4,代码行数:10,代码来源:SoundBase.cpp

示例9: ResolveRedirects

FStringAssetReference FStreamableManager::ResolveRedirects(FStringAssetReference const& Target) const
{
	FStringAssetReference const* Redir = StreamableRedirects.Find(Target);
	if (Redir)
	{
		check(Target != *Redir);
		UE_LOG(LogStreamableManager, Verbose, TEXT("Redirected %s -> %s"), *Target.ToString(), *Redir->ToString());
		return *Redir;
	}
	return Target;
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:11,代码来源:StreamableManager.cpp

示例10: FixMapAssetRef

// Backwards compat for map strings
void FixMapAssetRef(FStringAssetReference& MapAssetReference)
{
	const FString AssetRefStr = MapAssetReference.ToString();
	int32 DummyIndex;
	if (!AssetRefStr.IsEmpty() && !AssetRefStr.FindLastChar(TEXT('.'), DummyIndex))
	{
		FString MapName, MapPath;
		AssetRefStr.Split(TEXT("/"), &MapPath, &MapName, ESearchCase::IgnoreCase, ESearchDir::FromEnd);
		MapAssetReference.SetPath(FString::Printf(TEXT("%s/%s.%s"),*MapPath, *MapName, *MapName));
	}
};
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:12,代码来源:EngineSettingsModule.cpp

示例11: FindInMemory

void FStreamableManager::FindInMemory(FStringAssetReference& InOutTargetName, struct FStreamable* Existing)
{
	check(Existing);
	check(!Existing->bAsyncUnloadRequestOutstanding);
	check(!Existing->bAsyncLoadRequestOutstanding);
	UE_LOG(LogStreamableManager, Verbose, TEXT("     Searching in memory for %s"), *InOutTargetName.ToString());
	Existing->Target = StaticFindObject(UObject::StaticClass(), NULL, *InOutTargetName.ToString());

	UObjectRedirector* Redir = Cast<UObjectRedirector>(Existing->Target);
	if (Redir)
	{
		Existing->Target = Redir->DestinationObject;
		UE_LOG(LogStreamableManager, Verbose, TEXT("     Found redirect %s"), *Redir->GetFullName());
		if (!Existing->Target)
		{
			Existing->bLoadFailed = true;
			UE_LOG(LogStreamableManager, Warning, TEXT("Destination of redirector was not found %s -> %s."), *InOutTargetName.ToString(), *Redir->GetFullName());
		}
		else
		{
			UE_LOG(LogStreamableManager, Verbose, TEXT("     Redirect to %s"), *Redir->DestinationObject->GetFullName());
		}
	}
	if (Existing->Target)
	{
		FStringAssetReference PossiblyNewName(Existing->Target->GetPathName());
		if (InOutTargetName != PossiblyNewName)
		{
			UE_LOG(LogStreamableManager, Verbose, TEXT("     Name changed to %s"), *PossiblyNewName.ToString());
			StreamableRedirects.Add(InOutTargetName, PossiblyNewName);
			StreamableItems.Add(PossiblyNewName, Existing);
			StreamableItems.Remove(InOutTargetName);
			InOutTargetName = PossiblyNewName; // we are done with the old name
		}
		UE_LOG(LogStreamableManager, Verbose, TEXT("     Found in memory %s"), *Existing->Target->GetFullName());
		Existing->bLoadFailed = false;
	}
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:38,代码来源:StreamableManager.cpp

示例12: Unload

void FStreamableManager::Unload(FStringAssetReference const& InTargetName)
{
	check(IsInGameThread());
	FStringAssetReference TargetName = ResolveRedirects(InTargetName);
	FStreamable* Existing = StreamableItems.FindRef(TargetName);
	if (Existing)
	{
		UE_LOG(LogStreamableManager, Verbose, TEXT("Unload %s"), *TargetName.ToString());
		Existing->bAsyncLoadRequestOutstanding = false;
		Existing->bAsyncUnloadRequestOutstanding = true;
	}
	else
	{
		UE_LOG(LogStreamableManager, Verbose, TEXT("Attempt to unload %s, but it isn't loaded"), *TargetName.ToString());
	}
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:16,代码来源:StreamableManager.cpp

示例13: SetReimportData

void FPaperJsonSpriteSheetImporter::SetReimportData(const TArray<FString>& ExistingSpriteNames, const TArray< TAssetPtr<class UPaperSprite> >& ExistingSpriteAssetPtrs)
{
	check(ExistingSpriteNames.Num() == ExistingSpriteAssetPtrs.Num());
	if (ExistingSpriteNames.Num() == ExistingSpriteAssetPtrs.Num())
	{
		for (int i = 0; i < ExistingSpriteAssetPtrs.Num(); ++i)
		{
			const TAssetPtr<class UPaperSprite> SpriteAssetPtr = ExistingSpriteAssetPtrs[i];
			FStringAssetReference SpriteStringRef = SpriteAssetPtr.ToStringReference();
			if (!SpriteStringRef.ToString().IsEmpty())
			{
				UPaperSprite* LoadedSprite = Cast<UPaperSprite>(StaticLoadObject(UPaperSprite::StaticClass(), nullptr, *SpriteStringRef.ToString(), nullptr, LOAD_None, nullptr));
				if (LoadedSprite != nullptr)
				{
					ExistingSprites.Add(ExistingSpriteNames[i], LoadedSprite);
				}
			}
		}
	}
	bIsReimporting = true;
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:21,代码来源:PaperJsonSpriteSheetImporter.cpp

示例14: GetPreviewMesh

USkeletalMesh* UAnimationAsset::GetPreviewMesh() 
{
	USkeletalMesh* PreviewMesh = PreviewSkeletalMesh.Get();
	if(!PreviewMesh)
	{
		// if preview mesh isn't loaded, see if we have set
		FStringAssetReference PreviewMeshStringRef = PreviewSkeletalMesh.ToStringReference();
		// load it since now is the time to load
		if(!PreviewMeshStringRef.ToString().IsEmpty())
		{
			PreviewMesh = Cast<USkeletalMesh>(StaticLoadObject(USkeletalMesh::StaticClass(), NULL, *PreviewMeshStringRef.ToString(), NULL, LOAD_None, NULL));
			// if somehow skeleton changes, just nullify it. 
			if (PreviewMesh && PreviewMesh->Skeleton != Skeleton)
			{
				PreviewMesh = NULL;
				SetPreviewMesh(NULL);
			}
		}
	}

	return PreviewMesh;
}
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:22,代码来源:AnimationAsset.cpp

示例15: GetPreviewMesh

USkeletalMesh* USkeleton::GetPreviewMesh(bool bFindIfNotSet)
{
	USkeletalMesh* PreviewMesh = PreviewSkeletalMesh.Get();
	if(!PreviewMesh)
	{
		// if preview mesh isn't loaded, see if we have set
		FStringAssetReference PreviewMeshStringRef = PreviewSkeletalMesh.ToStringReference();
		// load it since now is the time to load
		if (!PreviewMeshStringRef.ToString().IsEmpty())
		{
			PreviewMesh = Cast<USkeletalMesh>(StaticLoadObject(USkeletalMesh::StaticClass(), NULL, *PreviewMeshStringRef.ToString(), NULL, LOAD_None, NULL));
		}
		
		// if not existing, and if bFindIfNotExisting is true, then try find one
		if (!PreviewMesh && bFindIfNotSet)
		{
			FARFilter Filter;
			Filter.ClassNames.Add(USkeletalMesh::StaticClass()->GetFName());

			FString SkeletonString = FAssetData(this).GetExportTextName();
			Filter.TagsAndValues.Add(GET_MEMBER_NAME_CHECKED(USkeletalMesh, Skeleton), SkeletonString);

			TArray<FAssetData> AssetList;
			FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
			AssetRegistryModule.Get().GetAssets(Filter, AssetList);

			if(AssetList.Num() > 0)
			{
				SetPreviewMesh( Cast<USkeletalMesh>(AssetList[0].GetAsset()), false );
				// update PreviewMesh
				PreviewMesh = PreviewSkeletalMesh.Get();
			}			
		}
	}

	return PreviewMesh;
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:37,代码来源:Skeleton.cpp


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