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 { }
 }
Exemple #2
0
 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 { }
 }
Exemple #3
0
 // Use this for initialization
 void Start()
 {
     p2s = GameObject.Find("Puzzle2").GetComponent <Puzzle2Script>();
 }