PhysicsSurfaceMaterial as a key for TMap

Yo, folks.

Plot

I want to have a static TMap of physics materials and their corresponding impact particle and sound cue that could be set-up in Editor. Like in ShooterExample but in a more intuitive and elegant way, i.e., w/o switch-cases and preprocessor macros.


Debugging

I have already understood how to initialize a static TMap within a class’ namespace. So I have the following variable in my AActor-inherited ImpactFX class:

UPROPERTY(EditDefaultsOnly, Category = Content)
TMap<TEnumAsByte<EPhysicalSurface>, FMaterialImpactData> Data;

I have one extra physics surface material (Snow) as shown on the image below.

282278-image-2019-07-13-09-34-03.png

However, in the Blueprint, I only have Default physics material, and cannot add any more entries (since [seems like] the engine doesn’t hook the rest of the materials).

282279-image-2019-07-13-09-36-09.png


How can I achieve that all the Editor-created physics materials could be used as keys for the initial variable? I have a suggestion that I have to use another type (one of the children) as a TMap key.