private void CleanUpGameElements() { Camera.main.transform.SetParent(null); Camera.main.transform.position = Vector3.back; Destroy(_player.gameObject); _player = null; }
private void SpawnGameElements() { var playerprefab = Resources.Load("Player"); var player = (GameObject)Instantiate(playerprefab); _player = player.GetComponent <Player.Player>(); Camera.main.transform.SetParent(_player.transform); }