Using a variable's contents for reference

I’m having difficulty asking this question, please bear with my ignorance of such things.

Basically, I want to do this. I know it’s wrong, but hopefully you can see what I mean.
I have a variable “RoomNum” which is the number of the room for this case of the script. I have the script on all of the rooms, and each example of the script already knows what it’s RoomNum is (int between 1-15). There’s 15 different room objects, each of which have a unique corresponding script, titled “Room” followed by their room number, and that script has unique information in it (cost, description, etc). So, suppose my script knows that it is room number 12 (RoomNum = 12). It then wants to find the room with the script “Room12”, and pull information from it, like the cost and description. I could do this by having a huge wall of if statements, like this

if (RoomNum == 1)
{Cost = FindObjectOfType<Room1>().GetComponent<RoomStats>().cost}

And I would have to do that for all 15 types. But, wouldn’t it be soooo much easier, if in the FindObjectOfType I could have the reference be variable? For example, something like this…
FindObjectOfType<“Room”+RoomNum>().GetComponent().cost}
I would only have to do this in ONE line, rather than like 60. I’ve had tons of moments when coding where I wish I could do this. Is there a way to let the <> know it’s contents are going to be variable?
Another way of asking this, is there a way for the CONTENTS of a variable to be what’s being used, rather than the name of the variable? We can do that easily in string, like this “Room”+RoomNum knows that it’s the word “Room” followed by the contents of the variable RoomNum. It seems so stupidly simple to me, but I can’t make it do it.
Is it impossible? Or am I just ignorant of the method? Hopefully this makes at least some sense. Thanks for any help you can provide/[/code]

Just thinking aloud…

You could make the 15 different scripts implement a common interface that returns their number.

public interface INumberable
{
   int GetIndex();          // make it return your identifier
}

Searching for interfaces en masse is not quite as slick as finding a single one with GetComponent, but you can do it by grabbing all MonoBehaviors with FindObjectsOfType(), and then asking each one if is an INumberable and if it is, add it to a collection, or add it and its underlying GameObject to that collection.

Once you had the collection you would iterate them to:

a) ask “Are you number X?”
b) if so, give me your GetComponent() component so I can set the cost

Maybe (probably) I’m missing something here, but if you have a List, and each List entry points to the room, isn’t that exactly what you are looking for? Each content of that List variable knows what the room is.

Edit: I was a bit too fast in my response
You may be able to employ some OOP, and first create a base Room class that defines the common variables, and then create the various subclasses that define the specifics that are different. That way you can always access what’s common (like cost), and still have different behavious, yet the code that accesses the classes is always the same.