本文整理汇总了C++中TObjectIterator类的典型用法代码示例。如果您正苦于以下问题:C++ TObjectIterator类的具体用法?C++ TObjectIterator怎么用?C++ TObjectIterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TObjectIterator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cleanUpTargets
void ACharacterTargetSystem::cleanUpTargets(UWorld* currentGameWorld)
{
// clean up all previous focused enemies
for (TObjectIterator<ABasicEnemy> enemyFocusIterator; enemyFocusIterator; ++enemyFocusIterator)
{
if (enemyFocusIterator->GetWorld() == currentGameWorld)
{
ABasicEnemy* enemyChar = *enemyFocusIterator;
if (!enemyChar->IsPendingKill())
{
enemyChar->hideFocusComponent();
enemyChar->removeFocus();
enemyChar->disableMenu();
}
}
}
// clean up all previous focused enemies
for (TObjectIterator<ABasicNpc> npcFocusIterator; npcFocusIterator; ++npcFocusIterator)
{
if (npcFocusIterator->GetWorld() == currentGameWorld)
{
ABasicNpc* npcChar = *npcFocusIterator;
npcChar->hideFocusComponent();
npcChar->removeFocus();
}
}
}
示例2: checkFreeTargetEnemies
// check only for enemies which are free to target in the given range
bool ACharacterTargetSystem::checkFreeTargetEnemies(ACharacter* player, UWorld* currentGameWorld, float distance)
{
ABasicEnemy* enemyChar;
bool enemyFreeForTarget = false;
float distanceToTarget = distance;
// TODO
for (TObjectIterator<ABasicEnemy> enemyIterator; enemyIterator; ++enemyIterator)
{
if (enemyIterator->GetWorld() == currentGameWorld)
{
enemyChar = *enemyIterator;
float distanceToPlayer = enemyChar->GetDistanceTo(player);
if (!enemyChar->IsPendingKill() && distanceToPlayer < distanceToTarget)
{
bool isEnemySkipped = enemyChar->bSkippedTarget;
if (!isEnemySkipped)
{
enemyFreeForTarget = true;
}
}
}
}
return enemyFreeForTarget;
}
示例3: UpdateAxisMapping
bool UInputBlueprintLibrary::K2_RebindAxisKey(FValorAxisInputBinding OriginalBinding, FValorAxisInputBinding NewBinding)
{
UInputSettings* Settings = const_cast<UInputSettings*>(GetDefault<UInputSettings>());
if (!Settings)
{
return false;
}
TArray<FInputAxisKeyMapping>& AxisMappings = Settings->AxisMappings;
bool bFound = false;
for (FInputAxisKeyMapping& AxisKeyMapping : AxisMappings)
{
if (AxisKeyMapping.AxisName.ToString() == OriginalBinding.AxisName && AxisKeyMapping.Key == OriginalBinding.Key)
{
UpdateAxisMapping(AxisKeyMapping, NewBinding);
bFound = true;
break;
}
}
if (bFound)
{
const_cast<UInputSettings*>(Settings)->SaveKeyMappings();
for (TObjectIterator<UPlayerInput> It; It; ++It)
{
It->ForceRebuildingKeyMaps(true);
}
}
return bFound;
}
示例4:
void UInputBlueprintLibrary::K2_RemoveAxisKeyBinding(FValorAxisInputBinding BindingToRemove)
{
UInputSettings* Settings = GetMutableDefault<UInputSettings>();
if (!Settings)
{
return;
}
TArray<FInputAxisKeyMapping>& AxisMappings = Settings->AxisMappings;
bool bFound = false;
for (int32 Index = 0; Index < AxisMappings.Num(); ++Index)
{
if (AxisMappings[Index].Key == BindingToRemove.Key)
{
bFound = true;
AxisMappings.RemoveAt(Index);
Index = 0;
}
}
if (bFound)
{
Settings->SaveKeyMappings();
for (TObjectIterator<UPlayerInput> It; It; ++It)
{
It->ForceRebuildingKeyMaps(true);
}
}
}
示例5: FlushRenderingCommands
FGlobalComponentReregisterContext::FGlobalComponentReregisterContext(const TArray<UClass*>& ExcludeComponents)
{
ActiveGlobalReregisterContextCount++;
// wait until resources are released
FlushRenderingCommands();
// Detach only actor components that are not in the excluded list
for(TObjectIterator<UActorComponent> ComponentIt;ComponentIt;++ComponentIt)
{
bool bShouldReregister=true;
for( int32 Idx=0; Idx < ExcludeComponents.Num(); Idx++ )
{
UClass* ExcludeClass = ExcludeComponents[Idx];
if( ExcludeClass &&
ComponentIt->IsA(ExcludeClass) )
{
bShouldReregister = false;
break;
}
}
if( bShouldReregister )
{
new(ComponentContexts) FComponentReregisterContext(*ComponentIt);
}
}
}
示例6: LoadBankByName
void UAkGameplayStatics::LoadBankByName(const FString& BankName)
{
FAkAudioDevice * AudioDevice = FAkAudioDevice::Get();
if( AudioDevice )
{
if(AudioDevice->GetAkBankManager() != NULL )
{
for ( TObjectIterator<UAkAudioBank> Iter; Iter; ++Iter )
{
if( Iter->GetName() == BankName )
{
Iter->Load();
return;
}
}
// Bank not found in the assets, load it by name anyway
AkUInt32 bankID;
AudioDevice->LoadBank(BankName, AK_DEFAULT_POOL_ID, bankID);
}
else
{
AkUInt32 bankID;
AudioDevice->LoadBank(BankName, AK_DEFAULT_POOL_ID, bankID);
}
}
}
示例7: UnloadBankByName
void UAkGameplayStatics::UnloadBankByName(const FString& BankName)
{
FAkAudioDevice * AudioDevice = FAkAudioDevice::Get();
if( AudioDevice )
{
if(AudioDevice->GetAkBankManager() != NULL )
{
for ( TObjectIterator<UAkAudioBank> Iter; Iter; ++Iter )
{
if( Iter->GetName() == BankName )
{
Iter->Unload();
return;
}
}
// Bank not found in the assets, unload it by name anyway
AudioDevice->UnloadBank(BankName);
}
else
{
AudioDevice->UnloadBank(BankName);
}
}
}
示例8: SetEditorScale
void UBillboardComponent::SetEditorScale(float InEditorScale)
{
EditorScale = InEditorScale;
for(TObjectIterator<UBillboardComponent> It; It; ++It)
{
It->MarkRenderStateDirty();
}
}
示例9: RecacheAllMaterialUniformExpressions
void UMaterialInterface::RecacheAllMaterialUniformExpressions()
{
// For each interface, reacache its uniform parameters
for( TObjectIterator<UMaterialInterface> MaterialIt; MaterialIt; ++MaterialIt )
{
MaterialIt->RecacheUniformExpressions();
}
}
示例10: OnObjectReimported
void OnObjectReimported(UObject* InObject)
{
if (UTexture2D* Texture = Cast<UTexture2D>(InObject))
{
for (TObjectIterator<UPaperSprite> SpriteIt; SpriteIt; ++SpriteIt)
{
SpriteIt->OnObjectReimported(Texture);
}
}
}
示例11: DeactivateAllColorPads
void UColorPadActivator::DeactivateAllColorPads()
{
for (TObjectIterator<UColorPadActivator> Itr; Itr; ++Itr)
{
UColorPadActivator *Trigger = *Itr;
Itr->IsActive = false;
if (Itr->GetOwner())
{
UE_LOG(LogTemp, Warning, TEXT("%s deactivated"), *Itr->GetOwner()->GetName());
}
}
return;
}
示例12: GetMyHealth
void AFPSCharacter::GetMyHealth()
{
if (GEngine)
{
TObjectIterator< APlayerController > ThePC;
UWorld* TheWorld = ThePC->GetWorld();
AFPSGM* MyGM = Cast<AFPSGM>(UGameplayStatics::GetGameMode(TheWorld));
if (MyGM != NULL)
{
GEngine->AddOnScreenDebugMessage(1, 5.f, FColor::Red, FString::FromInt(MyGM->Health));
}
}
}
示例13: GetUnitTestClassDefList
void NUTUtil::GetUnitTestClassDefList(TArray<UUnitTest*>& OutUnitTestClassDefaults)
{
for (TObjectIterator<UClass> It; It; ++It)
{
if (It->IsChildOf(UUnitTest::StaticClass()) && *It != UUnitTest::StaticClass() && *It != UClientUnitTest::StaticClass())
{
UUnitTest* CurDefault = Cast<UUnitTest>(It->GetDefaultObject());
if (CurDefault != NULL)
{
OutUnitTestClassDefaults.Add(CurDefault);
}
}
}
}
示例14: AssembleListOfExporters
void AssembleListOfExporters(TArray<UExporter*>& OutExporters)
{
auto TransientPackage = GetTransientPackage();
// @todo DB: Assemble this set once.
OutExporters.Empty();
for (TObjectIterator<UClass> It; It; ++It)
{
if (It->IsChildOf(UExporter::StaticClass()) && !It->HasAnyClassFlags(CLASS_Abstract))
{
UExporter* Exporter = NewObject<UExporter>(TransientPackage, *It);
OutExporters.Add(Exporter);
}
}
}
示例15: makeAllNpcsFocusable
void ACharacterTargetSystem::makeAllNpcsFocusable(UWorld* currentGameWorld)
{
ABasicNpc* npcChar;
for (TObjectIterator<ABasicNpc> npcFreeIterator; npcFreeIterator; ++npcFreeIterator)
{
if (npcFreeIterator->GetWorld() == currentGameWorld)
{
npcChar = *npcFreeIterator;
if (npcChar)
{
npcChar->bSkippedTarget = false;
}
}
}
}