void Awake() { //GETS COMPONENTS rb = GetComponent <Rigidbody>(); pui = GameObject.Find("Canvas").GetComponent <PlayerUI>(); spawnPoint = GameObject.Find("SpawnPoint").transform; transform.position = spawnPoint.position; try { p2s = GameObject.Find("Puzzle2").GetComponent <Puzzle2Script>(); } catch { } }
void Awake() { //GETS COMPONENTS rb = GetComponent <Rigidbody>(); levelName = SceneManager.GetActiveScene().name; pui = GameObject.Find("Canvas").GetComponent <PlayerUI>(); if (levelName == "CrossRoads" && PlayerPrefs.GetString("XroadsSpawn") != "") { spawnPoint = GameObject.Find(PlayerPrefs.GetString("XroadsSpawn")).transform; } else { spawnPoint = GameObject.Find("SpawnPoint").transform; } transform.position = spawnPoint.position; try { p2s = GameObject.Find("Puzzle2").GetComponent <Puzzle2Script>(); } catch { } }
// Use this for initialization void Start() { p2s = GameObject.Find("Puzzle2").GetComponent <Puzzle2Script>(); }