You can create an object in first scene, attach a sript to it and sen value of variable in this script. For example if you want to send user login script attachet to game object that will survife after second scene load should be:
// User login:
public var userLogin : String;
function Awake() {
// Do not destroy this game object:
DontDestroyOnLoad(this);
}
Set userLogin in first scene and read in second.
Complete example can be found in my blog http://unity-tutorials.blogspot.com/. Listing 20 and 21.
↧