Is it possible to pass variables from one object in one scene to another object in another scene?
If so, I need to pass unityNameSelected global variable from first script(which is listed bellow) attached in an object in scene 2 to the second script attached to another object in the scene 1. Thanks for any help.
{
while ( reader.Read() )
{
if ( reader.NodeType == XmlNodeType.Element )
{
if ( reader.HasAttributes )
{
if ( reader.GetAttribute("UnityName") != null )
{
unityName = reader.GetAttribute("UnityName");
if(!values.Contains(unityName))
{
values.Add(unityName);
DontDestroyOnLoad(GameObject.Find("unityName"));
unityNameSelected = unityName;
//string[] unityNameSelected3 = {unityName};
// unityNameSelected =unityNameSelected3;
print(unityNameSelected.ToString());
}
}
}
}
}}