Hello, i would like to do somthing like this
Scene1.js
Application.LoadLevel(“Scene2”, “CustomString”);
Scene2.js
function Start () {
var Param = GetLoadLvlParam();
}
Hello, i would like to do somthing like this
Scene1.js
Application.LoadLevel(“Scene2”, “CustomString”);
Scene2.js
function Start () {
var Param = GetLoadLvlParam();
}
You could create your own static class to provide your desired interface:
Level.js:
public static class Level {
public var LoadArgument : String = "";
public function Load(scene : String, arg : String) {
LoadArgument = arg;
Application.LoadLevel(scene);
}
}
Scene1.js:
function Start() {
Level.Load("Scene2", "CustomString");
}
Scene2.js:
function Start() {
var param : String = Level.LoadArgument;
print(param);
}