I was looking at that article before, when I was structuring out my enum; but it doesn’t explicitly say how to use it within a switch (at least not to my current knowledge).
So here’s my pseudo code and let me know if it seems right (I won’t be able to test it until after work).
Header file:
UENUM(BlueprintType)
enum class EStance : uint8
{
S_Standing UMETA(DisplayName = "Standing"),
S_Crouching UMETA(DisplayName = "Crouching")
};
UCLASS()
class YourClass : public YourSuperClass
{
GENERATED_UCLASS_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Enum)
EStance Stance;
//Rest of Class Code
};
CPP File
switch (Stance)
{
case 0:
// Player is standing
break;
case 1:
// Player is crouching
break;
}