<VA_Snippet>
<Language>C++</Language>
<Title>UE_TriggerSphere</Title>
<Shortcut>trigger</Shortcut>
<Description />
<Code>$Sphere$->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
$Sphere$->SetCollisionResponseToChannels(ECR_Ignore);
$Sphere$->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_TriggerBox</Title>
<Shortcut>trigger</Shortcut>
<Description />
<Code>$box$->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
$box$->SetCollisionResponseToChannels(ECR_Ignore);
$box$->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
$box$->SetBoxExtent(FVector(200.0f, 200.f, 200.0f));</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_CreateDefaultSubojject</Title>
<Shortcut>create</Shortcut>
<Description />
<Code>CreateDefaultSubobject<$class$>(TEXT("$name$"));</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_SpawnActor</Title>
<Shortcut>create</Shortcut>
<Description />
<Code>FActorSpawnParameters SpawnParmeters;
SpawnParmeters.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
GetWorld()->SpawnActor<AActor>($Cls$,EyeLocation, EyeRotation, SpawnParmeters);</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_GetAllActors</Title>
<Shortcut>allactors</Shortcut>
<Description />
<Code>TArray<AActor*> FoundActors;
UGameplayStatics::GetAllActorsOfClass(GetWorld(), $Class$::StaticClass(), FoundActors);
</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_GetAuthGameMode</Title>
<Shortcut>gamemode</Shortcut>
<Description>ue snippet by cg
</Description>
<Code>GetWorld()->GetAuthGameMode();</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_GetGameMode</Title>
<Shortcut>gamemode</Shortcut>
<Description>ue snippet by cg
</Description>
<Code>UGameplayStatics::GetGameMode(GetWorld());</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_OnOverlapEvent</Title>
<Shortcut>overlap</Shortcut>
<Description>ue snippet by cg
</Description>
<Code>UFUNCTION()
void BeginOverlapHandler(class UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);
UFUNCTION()
void EndOverlapHandler(class UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_PlaySound2D</Title>
<Shortcut>playsound</Shortcut>
<Description />
<Code>UGameplayStatics::PlaySound2D(this, $SoundBase$);</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_Quit</Title>
<Shortcut>quit</Shortcut>
<Description />
<Code>UKismetSystemLibrary::QuitGame(this, nullptr, EQuitPreference::Quit);</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_SetTimer</Title>
<Shortcut>timer</Shortcut>
<Description>ue snippet by cg
</Description>
<Code>FTimerHandle timerHandle;
GetWorldTimerManager().SetTimer(timerHandle, this, &$classname$::FnCallback, 0.5f, false);</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_SimpleMoveTo</Title>
<Shortcut>moveto</Shortcut>
<Description />
<Code>UNavigationSystem::SimpleMoveToActor(GetController(), $targetPoint$);</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_TEXT</Title>
<Shortcut>text</Shortcut>
<Description />
<Code>TEXT("$end$")</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_LogClass</Title>
<Shortcut>log</Shortcut>
<Description />
<Code>UE_LOG(LogClass, Log, TEXT("$str$%$type$"),$value$);</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_LogClass_blank</Title>
<Shortcut>log</Shortcut>
<Description />
<Code>UE_LOG(LogClass, Log, TEXT("$value$"));</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_LPrintMessage</Title>
<Shortcut>log</Shortcut>
<Description />
<Code>GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, FString::Printf(TEXT("$str$%$type$"), $value$));</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_SetParent</Title>
<Shortcut>setparent</Shortcut>
<Description />
<Code>SetupAttachment(RootComponent);</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_SpawnEmitter</Title>
<Shortcut>create</Shortcut>
<Description />
<Code>UGameplayStatics::SpawnEmitterAtLocation(this, PickupFx, GetActorLocation());</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_GetOverlappingComponents</Title>
<Shortcut>overlap</Shortcut>
<Description />
<Code>TArray<UPrimitiveComponent*> OverlappingComps;
OuterSphereComponent->GetOverlappingComponents(OverlappingComps);</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_Foreach_Pawn</Title>
<Shortcut>foriter</Shortcut>
<Description />
<Code>for (FConstPawnIterator it = GetWorld()->GetPawnIterator(); it; it++) {
APawn* Pawn = it->Get();
}</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_Foreach_PC</Title>
<Shortcut>foriter</Shortcut>
<Description />
<Code>for (FConstPlayerControllerIterator it = GetWorld()->GetPlayerControllerIterator(); it; it++) {
APlayerController* PC = it->Get();
}</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_Foreach_Actor</Title>
<Shortcut>foriter</Shortcut>
<Description />
<Code>for (TActorIterator<AActor> it(GetWorld()); it; ++it) {
AActor* Actor = *it;
}</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_Foreach_UObj</Title>
<Shortcut>foriter</Shortcut>
<Description />
<Code>for (TObjectIterator<$Class$> it; it;++it) {
$Class$* MyObj = *it;
}</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_LineTraceSingleByChannel</Title>
<Shortcut>linetrace</Shortcut>
<Description />
<Code>FHitResult HitResult;
FCollisionQueryParams QueryParams;
QueryParams.bTraceComplex = true;
FVector LookAtPoint = FVector();
bool TryTrace = GetWorld()->LineTraceSingleByChannel(HitResult, ViewPoint, ViewPoint + ViewRotation.Vector() * 10000.0f, ECC_Visibility, QueryParams);
if (TryTrace) {
LookAtPoint = HitResult.ImpactPoint;
}</Code>
</VA_Snippet>
<VA_Snippet>
<Language>C++</Language>
<Title>UE_OverlapMultiByObjectType</Title>
<Shortcut>overlap</Shortcut>
<Description>OverlapMultiByObjectType
</Description>
<Code>TArray<FOverlapResult> Overlaps;
TArray<TWeakObjectPtr<AActor>> OverlapedActors;
bool TraceComplex = false;
FCollisionQueryParams QueryParams;
QueryParams.bTraceComplex = TraceComplex;
QueryParams.bReturnPhysicalMaterial = false;
//APawn* MasterPawn = MasterPC->GetPawn();
//if (MasterPawn) QueryParams.AddIgnoredActor(MasterPawn->GetUniqueID());
bool TryOverlap = GetWorld()->OverlapMultiByObjectType(
Overlaps,
ViewLocation,
FQuat::Identity,
FCollisionObjectQueryParams(ECC_Pawn),
FCollisionShape::MakeSphere(Radius),
QueryParams);</Code>
</VA_Snippet>