Variables in Instantiated Prefab Scripts and OnGui

Hi, I learned a lot from Unity Answers and spent my whole weekend searching for a usable one as I don’t like posting ones myself. As I did not find anything suitable I do have to make that step:

My problem is that I have a prefab with a script as component. I Instantiate that prefab and while instantiating I change the variable of that script to a certain value

var Script = SomeArray[SomeInt].GetComponent(SpecificScript);
Script.CurID = GameSettings.BuildingID;

Now the instantiated object script uses that CurID variable as wished.
The problem I get is that the OnGUI() function in the prefab only uses the CurID of the first instantiated object.
Means if I use a menu of the second instantiated object the OnGUI() of this function uses the CurID of 1.
But when I pause the game and look in the inspector, the CurID variable of the cloned object is 2 as it should be.

What am I doing wrong? Or is this a known problem and is there a workaround?

I hope you got a sense of what my problem is, it is a little bit complicated thank you in advance for your help!

IgnorancelsBliss made the right suggestion, I used the GUI component with a static variable, so everytime an object was clicked it would show up the GUI of the first object, no matter what is number was, thank you very much! --@admin: Solved