Not sure how to actually phrase the question.
In UnityScript, if I have a class like this
var someObj = someClass();
var anotherObj = anotherClass();
class someClass
{
var name : String;
function someClass()
{
this.name = "TestName";
}
}
class anotherClass
{
var name : String;
function anotherClass()
{
this.name = someObj.name;
}
}
Why can’t I access the other objects variable “name” from within this, since someObj is within the scope of the script. Obviously my actual script is a bit more detailed, but before I keep going in the path I am going with it, I wonder if I should approach it from a different angle. Basically, I am writing a gui class that will have multiple methods within it (called by the main OnGui function) and other classes within the script that control various values within the game, but I will need the gui class object to be able to access the other objects
Note : When I am talking about objects here I do not mean gameObjects. I mean actual programming objects, or instances of the class.
Edit: Actually, I won’t be doing this because it’s really bad practice, but now, out of curiosity, is it actually possible?