How to do Multiple OnTriggerEnters

I’ve seen a couple of old posts that ask this question but i’m having trouble understanding the answers people have given. Can anyone explain it to me in an easy to understand way?

here is the code i’m trying to use. I need to return which tile the player is standing on (In this case the grasslandTile) and change the true/false for the other tiles.

	void OnTriggerEnter(Collider grasslandTile){
    		enterGrassland = true;
    		enterHouseWithTree = false;
    		enterSingleTree = false;
    	}

But I also need one thats like

void OnTriggerEnter(Collider houseWithTreeTile){
    		enterGrassland = false;
    		enterHouseWithTree = true;
    		enterSingleTree = false;
    	}

and then

  void OnTriggerEnter(Collider singleTreeTile){
            		enterGrassland = false;
            		enterHouseWithTree = false;
            		enterSingleTree = true;
            	}

So how do I get these all into one script? I need them all in one script to return the value for this

void OnGUI(){
		if(guiOn && enterGrassland == true)
		{ specific 
				GUI.Button(new Rect(10,200,1200,100), "Forage");
				GUI.Button(new Rect(10,400,1200,100), "Rest");
				GUI.Button(new Rect(10,600,1200,100), "Wait");
		}	
if(guiOn && enterHouseWithTree== true)
    		{ specific 
    				GUI.Button(new Rect(10,200,1200,100), "Search");
    				GUI.Button(new Rect(10,400,1200,100), "Rest");
    				GUI.Button(new Rect(10,600,1200,100), "Wait");
    		}	
    	}
    }

There can only be one OnTriggerEnter and it will be called no matter what name the collider has or what you name the collider variable in the method. What you need to do is within the method, check for the gameobject’s name.

For example:

void OnTriggerEnter(Collider collider){
             if(collider.gameObject.name == "Tree Tile") {
               enterGrassland = false;
               enterHouseWithTree = false;
               enterSingleTree = true;
             } else if(collider.gameObject.name == "Grass Tile") {
               //Do stuff.
             }
            }

You can put them all in one script, by simply putting them all in one script! I don’t quite understand the issue with that part.

Basically what you want to do is

(1) add tags to or give your objects individual names that the player can stand on

(2) In your code have a switch statement that looks at the tag/name of the thing it collided with.

 void OnTriggerEnter(Collider singleTreeTile){
     switch(singleTreeTile.gameObject.name){ // or singleTreeTile.gameObject.tag
          case "grassland":
                   // true false false
                   break;
         case "houseWithTree":
                   // false true false
                   break;
         case "houseWithTree":
                  //false false true
                   break;
         }
}