本文整理汇总了C++中APlayerController::ClientMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ APlayerController::ClientMessage方法的具体用法?C++ APlayerController::ClientMessage怎么用?C++ APlayerController::ClientMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类APlayerController
的用法示例。
在下文中一共展示了APlayerController::ClientMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetNavDrawDistance
void UCheatManager::SetNavDrawDistance(float DrawDistance)
{
if (GIsEditor)
{
APlayerController* PC = GetOuterAPlayerController();
if (PC != NULL)
{
PC->ClientMessage(TEXT("Setting Nav Rendering Draw Distance is not supported while in Edior"));
}
}
ARecastNavMesh::SetDrawDistance(DrawDistance);
}
示例2: Exec
bool FGameplayDebugger::Exec(UWorld* InWorld, const TCHAR* Cmd, FOutputDevice& Ar)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
bool bHandled = false;
if (FParse::Command(&Cmd, TEXT("RunEQS")) && InWorld)
{
APlayerController* MyPC = InWorld->GetGameInstance() ? InWorld->GetGameInstance()->GetFirstLocalPlayerController() : nullptr;
UAISystem* AISys = UAISystem::GetCurrent(*InWorld);
UEnvQueryManager* EQS = AISys ? AISys->GetEnvironmentQueryManager() : NULL;
if (MyPC && EQS)
{
AGameplayDebuggingReplicator* DebuggingReplicator = NULL;
for (TActorIterator<AGameplayDebuggingReplicator> It(InWorld); It; ++It)
{
AGameplayDebuggingReplicator* A = *It;
if (!A->IsPendingKill())
{
DebuggingReplicator = A;
if (!DebuggingReplicator->IsGlobalInWorld() && DebuggingReplicator->GetLocalPlayerOwner() == MyPC)
{
break;
}
}
}
UObject* Target = DebuggingReplicator != NULL ? DebuggingReplicator->GetSelectedActorToDebug() : NULL;
FString QueryName = FParse::Token(Cmd, 0);
if (Target)
{
AISys->RunEQS(QueryName, Target);
}
else
{
MyPC->ClientMessage(TEXT("No debugging target to run EQS"));
}
}
return true;
}
if (FParse::Command(&Cmd, TEXT("EnableGDT")) == false)
{
return false;
}
FString UniquePlayerId = FParse::Token(Cmd, 0);
APlayerController* LocalPC = NULL;
UWorld* MyWorld = InWorld;
if (MyWorld == nullptr)
{
if (UniquePlayerId.Len() > 0)
{
// let's find correct world based on Player Id
const TIndirectArray<FWorldContext> WorldContexts = GEngine->GetWorldContexts();
for (auto& Context : WorldContexts)
{
if (Context.WorldType != EWorldType::Game && Context.WorldType != EWorldType::PIE)
{
continue;
}
UWorld *CurrentWorld = Context.World();
for (FConstPlayerControllerIterator Iterator = CurrentWorld->GetPlayerControllerIterator(); Iterator; ++Iterator)
{
APlayerController* PC = *Iterator;
if (PC && PC->PlayerState->UniqueId.ToString() == UniquePlayerId)
{
LocalPC = PC;
MyWorld = PC->GetWorld();
break;
}
}
if (LocalPC && MyWorld)
{
break;
}
}
}
}
if (MyWorld == nullptr)
{
return false;
}
if (LocalPC == nullptr)
{
if (UniquePlayerId.Len() > 0)
{
for (FConstPlayerControllerIterator Iterator = MyWorld->GetPlayerControllerIterator(); Iterator; ++Iterator)
{
APlayerController* PlayerController = *Iterator;
UE_LOG(LogGameplayDebugger, Log, TEXT("- Client: %s"), *PlayerController->PlayerState->UniqueId.ToString());
if (PlayerController && PlayerController->PlayerState->UniqueId.ToString() == UniquePlayerId)
{
//.........这里部分代码省略.........