void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Player")) { if (safePoint == null) { LastSafezone.SetLastSafePosition(other.gameObject.transform.position); } else { LastSafezone.SetLastSafePosition(safePoint.position); } } }
// Start is called before the first frame update void Start() { LastSafezone.SetLastSafePosition(GameObject.FindGameObjectWithTag("Player").transform.position); Unity.LEGO.Game.EventManager.AddListener <Unity.LEGO.Game.DeathEvent>(OnPlayerDeath); GameInfo.ActiveScene = SceneManager.GetActiveScene().name; }