Assigning Material to objects based on an enum

I have an enum for different enemy types and I want to apply a Material to an enemy based on an enum type. This is the approach I am using at the moment:

public enum EnemyType {
    Normal,
    Jumper
};

[SerializeField]
Material materialNormalEnemy;

[SerializeField]
Material materialJumperEnemy;

public void ApplyMaterialOnEnemy(GameObject enemy, EnemyType enemyType)
{
    if (enemyType == EnemyType.Normal)
    {
        enemy.GetComponent<Renderer>().material = materialNormalEnemy;
    }
    else if (enemyType == EnemyType.Jumper)
    {
        enemy.GetComponent<Renderer>().material = materialJumperEnemy;
    }
}

Is there a way to directly pass the Material into the enum as a parameter and then just retrieve those? Here is what I am thinking:

[SerializeField]
Material materialNormalEnemy;

[SerializeField]
Material materialJumperEnemy;

public enum EnemyType(Material material) {
    Normal(materialNormalEnemy),
    Jumper(materialJumperEnemy)
};

public void ApplyMaterialOnEnemy(GameObject enemy, EnemyType enemyType)
{
    enemy.GetComponent<Renderer>().material = enemyType.material;
}

Is something similar possible in C#?

Not with enums on their own. You need to create an actual object(s) that holds this information. For example with a scriptable object for enemy types, that holds all the pertinent information on each type: Unity - Manual: ScriptableObject

Try to avoid enums as they generally devolve into anti-patterns.

Can you maybe explain how these Scriptable Objects could be applied to my speicifc case? What would you suggets I use instead of Enums for keeping track of different enemy types?

Literally what I already said: scriptable objects. Really it boils down to defining objects with the data and functionality you need:

[CreateAssetMenu]
public class EnemyType : ScriptableObject
{
    [SerializeField]
    private string _enemyTypeName;
    
    [SerializeField]
    private Material _enemyTypeMaterial;
    
    public string EnemyTypeName => _enemyTypeName;
    
    public Material EnemyTypeMaterial _enemyTypeMaterial;
}

I figure you’re spawning enemy’s and applying modifications to them based on their type. With this, you can simply take the data from the enemy type scriptable object and apply that to the game object.

Though it will make more sense to have a component on the enemy itself that you pass the type to and it can internally set things up.