detecting enum type?

Hello All…I am new at unity and c#…I am stuck with enums…

I have an enum which holds the various types of grounds.(none,flat,downward)…I want to have my script detecting various types of grounds…

i can detect flat(using Ontrigger), but I am stuck at the point of having it to detect the downward…

How to I go about doing this?Can I change the value of the enum somehow? If so then how?

-----I have the enum declared in a script…

public enum EGroundTypes { None, Floor, SlopeDown, }

-----and I have another script with the ontriggerenter function accessing this enum…

EGroundTypes m_EFloorVariable = EGroundTypes.Floor;

 void OnTriggerEnter(Collider a_collider)
    {
Debug.Log ("collided with " + a_collider.gameObject.tag);
		
		switch(m_EFloorVariable)
		{
			case EGroundTypes.Floor:
			Debug.Log("Enum floor");
			Iobj.MakingIsGroundEnteredTrue(); 
			break;
		}

Sorry for amateur question.Plz help

but I am stuck at the point of having it to detect the downward

What’s preventing you from checking the rest of the cases?

public enum EGroundTypes { None, Floor, SlopeDown, Downward, etc }    

EGroundTypes m_EFloorVariable = EGroundTypes.Floor;        

void OnTriggerEnter(Collider a_collider)
{
    Debug.Log ("collided with " + a_collider.gameObject.name); // I think the name's better than tag here.
     
    switch(m_EFloorVariable)
    {
      case EGroundTypes.Floor:
        // do something
        break;
      case EGroundTypes.SlopeDown:
        // do something
        break;
      case EGroundTypes.Downward:
        // do something
        break;
      case EGroundTypes.etc:
        // do something
        break;
    }
}

Looks like your private variable m_EFloorVariable is always set to EGroundTypes.Floor. What you may want to do instead is to make it a public variable so it gets exposed in Unity editor, then add your script to each ground object in the scene and set the ground type for each ground object right inside the editor.

class GroundScript {
...
    //drag GroundScript onto each ground object in the scene
    //then change "Ground Type" property right in the editor
    public EGroundTypes groundType = EGroundTypes.None;
...
    void OnCollisionEnter(Collider collider) {
        switch (groundType) {
        case EGroundTypes.Floor:
            //action
            break;

        case EGroundTypes.SlopeDown:
            //action
            break;
        ...
        }
    }
}