So I am trying to make a general C++ static that just holds string variables. I am using Unreal Engine 4 in this project. I have a working solution, but am looking to see if what I do in C# can be done in C++.
Working Solution (C++): DFControllerGameModeBase.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "DFControllerGameModeBase.generated.h"
#define MoveForwardInput "MoveForward"
Implementation:
#include "DFControllerGameModeBase.h"
void ADFCharacter::Play(){
.....
string text = MoveForwardInput;
}
However this is what I do in C# with Unity:
using System;
namespace Assets.Scripts.Helpers
{
public static class Utilities
{
public static string MoveForward = "MoveForward";
}
}
Implementation:
using Assets.Scripts.Helpers;
void Play(){
string text = Utilities.MoveForward;
}