How do I have a game object access the enums on another game object on collision?

Hi, I just have a quick question.

So I’m making a 2D game and to make it easier on myself in the long-run I wanted to create a system where I input the various properties of an attack and when my player character is hit it will react according to what I’ve put as it’s responses.

My problem is that I don’t exactly know how to access the properties of an object while it is colliding in the code. Nor do I know if that it is actually the best way to go about it.

Firstly, I want to be able to differentiate between a light and a heavy attack so that a different amount of health can be taken from the player character, and if it was just two different attack types I would used scripts but I want there to be several different parameters that the player can react to.

Here is what my Enemy Attack Parameter Script looks like:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public enum EnemyAttackStrength
{
    light,
    heavy,
}
 
 
public enum EnemyAttackType
{
    melee,
    ranged,
    special,
}
 
public enum EnemyAttackElement
{
    none,
    fire,
    ice,
    electric,
    crystal,
    poision,
}
 
public class EnemyAttack: MonoBehaviour
{
    public EnemyAttackStrength thisAttackStrength;
    public EnemyAttackType thisAttackType;
    public EnemyAttackElement thisAttackElement;
}

And here is the excerpt where I’m trying to have the player detect what enum the enemy attack is:

    private void OnTriggerEnter2D(Collider2D collision)
        {
            if (collision.gameObject.tag == ("Enemy"))
            {
                if (collision.gameObject.GetComponent<EnemyAttack>()) //obviously a mockup
                {
                    if (thisPlayerInvulnerability == playerInvulnerability.vulnerable)
                    {
                        health = health - 5;
                        player.tookDamage = true;
                        ChangeVulnerability(playerInvulnerability.invulerable);
                        StartCoroutine(InvincibilityTimer());
                    }
                    else if (thisPlayerInvulnerability == playerInvulnerability.invulerable)
                    {
                        health = health - 0;
                        player.tookDamage = false;
                    }
                }
            }

Thank you for anyone willing to help, I really appreciate it!

Here is an example how to enter the enenies enums:

private void OnTriggerEnter2D(Collider2D collision) {
       if (collision.CompareTag("Enemy")) {
           EnemyAttack enemyAttack = collision.GetComponent<EnemyAttack>()
           if (enemyAttack != null) {
                EnemyAttackStrength enemyAttackStrength = enemyAttack.thisAttackStrenght
                //...
           }
      }
}