void Awake() { persistantObject = GameObject.Find("PersistantGameObject"); //load persistantObjectScript attached to persistantObject script = persistantObject.GetComponent <PersistObjectScript>(); finalText.text = script.Data; }
public void LoadFinalScene(string text) { //load persistantObjectScript attached to persistantObject persistantGameObject = GameObject.Find("PersistantGameObject"); script = persistantGameObject.GetComponent <PersistObjectScript>(); script.Data = text; SceneManager.LoadScene("Koniec"); }