Pawns, Player Controllers, Player Input, Cheat Managers, Game Modes, Game Instances 。 必须要继承以上的类
// Fill out your copyright notice in the Description page of Project Settings.
#include "MyCheatManager.h"
void UMyCheatManager::TestForCmd(int a)
{
UE_LOG(LogTemp, Warning, TEXT("CMD RES = %d"), a);
return;
}
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/CheatManager.h"
#include "MyCheatManager.generated.h"
/**
*
*/
UCLASS()
class TESTFORCMD_API UMyCheatManager : public UCheatManager
{
GENERATED_BODY()
public:
UFUNCTION(Exec)
void TestForCmd(int a);
};