How to create a globally-available enum?

#pragma once is poor form.

You actually had almost the right solution already in the original file, except you had the “#endif” for the GB_H in the wrong place – it should be at the end.


#ifndef __GB_H__
#define __GB_H__

#include "Engine.h"

#define COLLISION_PROJECTILE ECC_GameTraceChannel1

// #endif  // this was wrong

#include "GB.generated.h"


UENUM(BlueprintType)
enum EItemAnimType
{
None UMETA(DisplayName = "None"),
Rifle UMETA(DisplayName = "Rifle"),
Handgun UMETA(DisplayName = "Handgun"),
Melee UMETA(DisplayName = "Melee")
};

#endif  // this is what it should have been