本文整理汇总了C++中FStringAssetReference::SetPath方法的典型用法代码示例。如果您正苦于以下问题:C++ FStringAssetReference::SetPath方法的具体用法?C++ FStringAssetReference::SetPath怎么用?C++ FStringAssetReference::SetPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FStringAssetReference
的用法示例。
在下文中一共展示了FStringAssetReference::SetPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleAssetDeleted
/** Handles cleaning up an object library if it matches the passed in object */
void UGameplayCueManager::HandleAssetDeleted(UObject *Object)
{
FStringAssetReference StringRefToRemove;
UBlueprint* Blueprint = Cast<UBlueprint>(Object);
if (Blueprint && Blueprint->GeneratedClass)
{
UGameplayCueNotify_Static* StaticCDO = Cast<UGameplayCueNotify_Static>(Blueprint->GeneratedClass->ClassDefaultObject);
AGameplayCueNotify_Actor* ActorCDO = Cast<AGameplayCueNotify_Actor>(Blueprint->GeneratedClass->ClassDefaultObject);
if (StaticCDO || ActorCDO)
{
StringRefToRemove.SetPath(Blueprint->GeneratedClass->GetPathName());
}
}
if (StringRefToRemove.IsValid())
{
TArray<FStringAssetReference> StringRefs;
StringRefs.Add(StringRefToRemove);
check(GlobalCueSet);
GlobalCueSet->RemoveCuesByStringRefs(StringRefs);
OnGameplayCueNotifyAddOrRemove.Broadcast();
}
}
示例2: 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));
}
};
示例3: HandleAssetAdded
void UGameplayCueManager::HandleAssetAdded(UObject *Object)
{
UBlueprint* Blueprint = Cast<UBlueprint>(Object);
if (Blueprint && Blueprint->GeneratedClass)
{
UGameplayCueNotify_Static* StaticCDO = Cast<UGameplayCueNotify_Static>(Blueprint->GeneratedClass->ClassDefaultObject);
AGameplayCueNotify_Actor* ActorCDO = Cast<AGameplayCueNotify_Actor>(Blueprint->GeneratedClass->ClassDefaultObject);
if (StaticCDO || ActorCDO)
{
if (IsAssetInLoadedPaths(Object))
{
FStringAssetReference StringRef;
StringRef.SetPath(Blueprint->GeneratedClass->GetPathName());
TArray<FGameplayCueReferencePair> CuesToAdd;
if (StaticCDO)
{
CuesToAdd.Add(FGameplayCueReferencePair(StaticCDO->GameplayCueTag, StringRef));
}
else if (ActorCDO)
{
CuesToAdd.Add(FGameplayCueReferencePair(ActorCDO->GameplayCueTag, StringRef));
}
check(GlobalCueSet);
GlobalCueSet->AddCues(CuesToAdd);
OnGameplayCueNotifyAddOrRemove.Broadcast();
}
else
{
VerifyNotifyAssetIsInValidPath(Blueprint->GetOuter()->GetPathName());
}
}
}
}
示例4: BuildCuesToAddToGlobalSet
void UGameplayCueManager::BuildCuesToAddToGlobalSet(const TArray<FAssetData>& AssetDataList, FName TagPropertyName, bool bAsyncLoadAfterAdd, TArray<FGameplayCueReferencePair>& OutCuesToAdd, FOnGameplayCueNotifySetLoaded OnLoaded, FShouldLoadGCNotifyDelegate ShouldLoad)
{
IGameplayTagsModule& GameplayTagsModule = IGameplayTagsModule::Get();
TArray<FStringAssetReference> AssetsToLoad;
AssetsToLoad.Reserve(AssetDataList.Num());
for (FAssetData Data: AssetDataList)
{
// If ShouldLoad delegate is bound and it returns false, don't load this one
if (ShouldLoad.IsBound() && (ShouldLoad.Execute(Data) == false))
{
continue;
}
const FString* FoundGameplayTag = Data.TagsAndValues.Find(TagPropertyName);
if (FoundGameplayTag && FoundGameplayTag->Equals(TEXT("None")) == false)
{
const FString* GeneratedClassTag = Data.TagsAndValues.Find(TEXT("GeneratedClass"));
if (GeneratedClassTag == nullptr)
{
ABILITY_LOG(Warning, TEXT("Unable to find GeneratedClass value for AssetData %s"), *Data.ObjectPath.ToString());
continue;
}
ABILITY_LOG(Log, TEXT("GameplayCueManager Found: %s / %s"), **FoundGameplayTag, **GeneratedClassTag);
FGameplayTag GameplayCueTag = GameplayTagsModule.GetGameplayTagsManager().RequestGameplayTag(FName(**FoundGameplayTag), false);
if (GameplayCueTag.IsValid())
{
// Add a new NotifyData entry to our flat list for this one
FStringAssetReference StringRef;
StringRef.SetPath(FPackageName::ExportTextPathToObjectPath(*GeneratedClassTag));
OutCuesToAdd.Add(FGameplayCueReferencePair(GameplayCueTag, StringRef));
AssetsToLoad.Add(StringRef);
}
else
{
ABILITY_LOG(Warning, TEXT("Found GameplayCue tag %s in asset %s but there is no corresponding tag in the GameplayTagManager."), **FoundGameplayTag, *Data.PackageName.ToString());
}
}
}
if (bAsyncLoadAfterAdd)
{
auto ForwardLambda = [](TArray<FStringAssetReference> AssetList, FOnGameplayCueNotifySetLoaded OnLoadedDelegate)
{
OnLoadedDelegate.ExecuteIfBound(AssetList);
};
if (AssetsToLoad.Num() > 0)
{
StreamableManager.RequestAsyncLoad(AssetsToLoad, FStreamableDelegate::CreateStatic( ForwardLambda, AssetsToLoad, OnLoaded));
}
else
{
// Still fire the delegate even if nothing was found to load
OnLoaded.ExecuteIfBound(AssetsToLoad);
}
}
}