#include <GameplayDebugger.h>
#include <GameplayDebuggerPlayerManager.h>
void AMyPlayerController::BeginPlay()
{
Super::BeginPlay();
#if WITH_GAMEPLAY_DEBUGGER
GetWorld()->GetTimerManager().SetTimerForNextTick(this, &AMyPlayerController::DisableGameplayDebugger);
#endif
}
void AMyPlayerController::DisableGameplayDebugger()
{
// This needs to wait until after AGameplayDebuggerPlayerManager has finished setting up, which can take multiple frames on clients.
#if WITH_GAMEPLAY_DEBUGGER
UC0GameInstance* GI = UC0Statics::GetGameInstance();
// Disabled in the main menu, and for clients.
if (IGameplayDebugger::IsAvailable())
{
AGameplayDebuggerPlayerManager& Manager = AGameplayDebuggerPlayerManager::GetCurrent(GetWorld());
if (UInputComponent* ManagerInput = Manager.GetInputComponent(*this))
{
PopInputComponent(ManagerInput);
}
else
{
// Try again next tick until ready
GetWorld()->GetTimerManager().SetTimerForNextTick(this, &AMyPlayerController::DisableGameplayDebugger);
}
}
#endif
}
Désactiver le debugger (console) et la touche ‘
Reply