Hello everyone !
thank you all for your useful helps in advance !
I wanted to know that, how I can use a user created gameobject in another scene ?
like user creates a building shape and can use it in other scene ?
I found these but didn’t help much !
// Use this for initialization
void Start () {
DontDestroyOnLoad (transform.gameObject);
}
// Update is called once per frame
void Update () {
}
public class CarScene : MonoBehaviour {
public GameObject selectedCar;
void Update() {
//Perform update logic here.. i.e. changing the selected car, etc.
}
void OnGUI() {
if(GUI.Button(<Rect>, "Select")) {
DontDestroyOnLoad(selectedCar);
Application.LoadLevel(<string>);
}
}
}