private void Awake() { DontDestroyOnLoad(this); if (player == null) { player = this; } else { Destroy(gameObject); } if (playerStart == null) { playerStart = FindObjectOfType <PlayerStart>(); } gameObject.transform.position = playerStart.GetPosition(); source = GetComponent <AudioSource>(); }
private void OnLevelWasLoaded(int level) { playerStart = FindObjectOfType <PlayerStart>(); gameObject.transform.position = playerStart.GetPosition(); }