hi i got a problem. i have 2 script "a" and "b". there is code inside "a"( var x : String ; x = Unity;) and "b" has this code -> if(GUI.Button(Rect(10,10,10,10), "Click me")){ Print x;} . i need x(String) inside b Script. and they are another object........ i used to DoSomething(). but i think this fucntion not necessary this time. please tell me what i have to.
This is a basic programming issue and not a Unity question, and similar questions have been asked before. You need only to search for reference to get a list.
Use gameObject.GetComponent(nameOfScript) to store a reference to the script. Declare the variable for storing said script like so
var scriptRef : nameOfScript;