本文整理汇总了C++中TObjectIterator类的典型用法代码示例。如果您正苦于以下问题:C++ TObjectIterator类的具体用法?C++ TObjectIterator怎么用?C++ TObjectIterator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TObjectIterator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
}
}
开发者ID:xhallix,项目名称:UnrealEngine_Manajourney,代码行数:29,代码来源:CharacterTargetSystem.cpp
示例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;
}
开发者ID:xhallix,项目名称:UnrealEngine_Manajourney,代码行数:26,代码来源:CharacterTargetSystem.cpp
示例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;
}
开发者ID:Shirasho,项目名称:ValorGame,代码行数:32,代码来源:InputBlueprintLibrary.cpp
示例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);
}
}
}
开发者ID:Shirasho,项目名称:ValorGame,代码行数:31,代码来源:InputBlueprintLibrary.cpp
示例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);
}
}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:27,代码来源:ActorComponent.cpp
示例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);
}
}
}
开发者ID:bozaro,项目名称:WwiseUE4Plugin,代码行数:28,代码来源:AkGameplayStatics.cpp
示例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);
}
}
}
开发者ID:bozaro,项目名称:WwiseUE4Plugin,代码行数:26,代码来源:AkGameplayStatics.cpp
示例8: SetEditorScale
void UBillboardComponent::SetEditorScale(float InEditorScale)
{
EditorScale = InEditorScale;
for(TObjectIterator<UBillboardComponent> It; It; ++It)
{
It->MarkRenderStateDirty();
}
}
开发者ID:johndpope,项目名称:UE4,代码行数:8,代码来源:BillboardComponent.cpp
示例9: RecacheAllMaterialUniformExpressions
void UMaterialInterface::RecacheAllMaterialUniformExpressions()
{
// For each interface, reacache its uniform parameters
for( TObjectIterator<UMaterialInterface> MaterialIt; MaterialIt; ++MaterialIt )
{
MaterialIt->RecacheUniformExpressions();
}
}
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:8,代码来源:MaterialInterface.cpp
示例10: OnObjectReimported
void OnObjectReimported(UObject* InObject)
{
if (UTexture2D* Texture = Cast<UTexture2D>(InObject))
{
for (TObjectIterator<UPaperSprite> SpriteIt; SpriteIt; ++SpriteIt)
{
SpriteIt->OnObjectReimported(Texture);
}
}
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:10,代码来源:Paper2DEditorModule.cpp
示例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;
}
开发者ID:JaredSelling,项目名称:BuildingEscapeGame,代码行数:13,代码来源:ColorPadActivator.cpp
示例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));
}
}
}
开发者ID:Insteren,项目名称:Unreal_Engine,代码行数:13,代码来源:FPSCharacter.cpp
示例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);
}
}
}
}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:15,代码来源:NUTUtil.cpp
示例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);
}
}
}
开发者ID:Nicole-W,项目名称:janusvr_utils,代码行数:15,代码来源:JanusExporterTool.cpp
示例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;
}
}
}
}
开发者ID:xhallix,项目名称:UnrealEngine_Manajourney,代码行数:15,代码来源:CharacterTargetSystem.cpp
示例16: makeAllEnemiesFocusable
void ACharacterTargetSystem::makeAllEnemiesFocusable(UWorld* currentGameWorld)
{
ABasicEnemy* enemyChar;
for (TObjectIterator<ABasicEnemy> enemyFreeIterator; enemyFreeIterator; ++enemyFreeIterator)
{
if (enemyFreeIterator->GetWorld() == currentGameWorld)
{
enemyChar = *enemyFreeIterator;
if (enemyChar && !enemyChar->IsPendingKill())
{
enemyChar->bSkippedTarget = false;
}
}
}
}
开发者ID:xhallix,项目名称:UnrealEngine_Manajourney,代码行数:16,代码来源:CharacterTargetSystem.cpp
示例17: traceParams
bool ASkill::SphereTrace(AActor* actorToIgnore, const FVector& start, const FVector& end, const float radius, TArray<FHitResult>& hitOut, ECollisionChannel traceChannel /* = ECC_Pawn */)
{
FCollisionQueryParams traceParams(FName(TEXT("Sphere Trace")), true, actorToIgnore);
traceParams.bTraceComplex = true;
traceParams.bReturnPhysicalMaterial = false;
traceParams.AddIgnoredActor(actorToIgnore);
TObjectIterator<APlayerController> pc;
if (!pc)
return false;
DrawDebugSphere(pc->GetWorld(), start, radius, 8, FColor::Red, true);
return pc->GetWorld()->SweepMultiByChannel(hitOut, start, end, FQuat(), traceChannel, FCollisionShape::MakeSphere(radius), traceParams);
}
开发者ID:weelcheel,项目名称:Mythos-Realm,代码行数:16,代码来源:Skill.cpp
示例18: PostEditChangeProperty
void USoundCue::PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent)
{
Super::PostEditChangeProperty(PropertyChangedEvent);
if (PropertyChangedEvent.Property)
{
for (TObjectIterator<UAudioComponent> It; It; ++It)
{
if (It->Sound == this && It->bIsActive)
{
It->Stop();
It->Play();
}
}
}
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:16,代码来源:SoundCue.cpp
示例19: checkFreeTargetNpcs
void ACharacterTargetSystem::findNPCTargetByDistance(ACharacter* player, UWorld* currentGameWorld, float distance)
{
ABasicNpc* npcChar;
float distanceToPlayer;
float distanceToTarget = distance;
bool npcFreeForTarget = checkFreeTargetNpcs(currentGameWorld);
// if every enemy has been skipped, set all to be focusable again
if (!npcFreeForTarget)
{
makeAllNpcsFocusable(currentGameWorld);
}
// get distance to enemy that can be focused
for (TObjectIterator<ABasicNpc> npcFocusIterator; npcFocusIterator; ++npcFocusIterator)
{
if (npcFocusIterator->GetWorld() == currentGameWorld)
{
npcChar = *npcFocusIterator;
if (npcChar && player && npcChar->bSkippedTarget == false)
{
distanceToPlayer = npcChar->GetDistanceTo(player);
if (distanceToPlayer < distanceToTarget)
{
npcChar->bSkippedTarget = true;
npcChar->setFocus();
targetedNpc = npcChar;
break;
}
else
{
npcChar->removeFocus();
targetedNpc = nullptr;
}
}
else
{
npcChar->removeFocus();
targetedNpc = nullptr;
}
}
}
}
开发者ID:xhallix,项目名称:UnrealEngine_Manajourney,代码行数:46,代码来源:CharacterTargetSystem.cpp
示例20: GetWorld
void ULevelStreaming::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
UProperty* OutermostProperty = PropertyChangedEvent.Property;
if ( OutermostProperty != NULL )
{
const FName PropertyName = OutermostProperty->GetFName();
if (PropertyName == GET_MEMBER_NAME_CHECKED(ULevelStreaming, LevelTransform))
{
GetWorld()->UpdateLevelStreaming();
}
if (PropertyName == GET_MEMBER_NAME_CHECKED(ULevelStreaming, EditorStreamingVolumes))
{
RemoveStreamingVolumeDuplicates();
// Update levels references in each streaming volume
for (TActorIterator<ALevelStreamingVolume> It(GetWorld()); It; ++It)
{
(*It)->UpdateStreamingLevelsRefs();
}
}
else if (PropertyName == GET_MEMBER_NAME_CHECKED(ULevelStreaming, LevelColor))
{
// Make sure the level's Level Color change is applied immediately by reregistering the
// components of the actor's in the level
if( LoadedLevel != NULL )
{
UPackage* Package = LoadedLevel->GetOutermost();
for( TObjectIterator<UActorComponent> It; It; ++It )
{
if( It->IsIn( Package ) )
{
UActorComponent* ActorComponent = Cast<UActorComponent>( *It );
if( ActorComponent )
{
ActorComponent->RecreateRenderState_Concurrent();
}
}
}
}
}
}
Super::PostEditChangeProperty(PropertyChangedEvent);
}
开发者ID:ErwinT6,项目名称:T6Engine,代码行数:46,代码来源:LevelStreaming.cpp
注:本文中的TObjectIterator类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论