Chapter 54

2.2.2 【UE C++】コンソールデバッグ追加

ひえひえ
ひえひえ
2023.01.23に更新

概要

楽します。

内容

https://historia.co.jp/archives/839/
ここ参照。

予備

ページが消えてしまったと起用のため簡易的に記載。

クラスを用意

CheatManagerクラスを作成する。

コード作成

ヘッダー

// 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 プロジェクト名_API Uクラス名 : public UCheatManager
{
	GENERATED_BODY()

public:
	UFUNCTION(exec)
	void SAMPLE_OutputLog(FString Message);
	
};

cpp

// Fill out your copyright notice in the Description page of Project Settings.


#include "クラス.h"


void Uクラス::SAMPLE_OutputLog(FString Message)
{
	UE_LOG(LogTemp, Log, TEXT("Test%s"), *Message);
}