I want keep a series of data from a scene in the Statescene variable.
Since many of the data are arrays, I declare them like this in the scene_init.script:
if(!StateSomewhere.Visited)
{
StateSomewhere.Visited = true;
// this is our first visit in this scene...
StateSomewhere.p1 = new Array("eje1", 108, 39);
StateSomewhere.p2 = new Array("eje1", -94, 18);
StateSomewhere.p3 = new Array("eje1", -94, 18);
StateSomewhere.p4 = new Array("eje1", -94, 18);
StateSomewhere.c1 = new Array(4, 3, 2, 1);
StateSomewhere.c2 = new Array();
StateSomewhere.c3 = new Array();
// etc...
}
But the problem come later, when I want to use those variables, for example:
if(StateSomewhere.c1.Length==0)
{
//make something useful
}
or
if(StateSomewhere.p2[1]==1)
{
//do something
}
If I make a variable like
global test = StateSomewhere.c1;
and then I call (for example) test.Length or test[2], there are no problems, but, will the changes made to test affect the original StateSomewhere.c1 variable?