////////////////////////////////////////////////////////////////////////////////
// scene state
global Statenew_scene;
// default values
if(Statenew_scene==null)
{
Statenew_scene.Visited = false;
// add scene states here
}
////////////////////////////////////////////////////////////////////////////////
// setup scene according to state variables
if(!Statenew_scene.Visited)
{
Statenew_scene.Visited = true;
//do something
}