示例#1
0
 /// <summary>
 /// This function is called when the player dies
 /// </summary>
 public void Die()
 {
     OnPlayerDies?.Invoke();
     score.CheckRecord();
     cam.transform.parent = null;
     rb.isKinematic       = false;
     canMove = false;
     StartCoroutine(RestartGame());
     //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
 }
示例#2
0
        private void Start()
        {
            _player.SetOnDeath(() => OnPlayerDies.Invoke(_player.HasRevived()));

            _player.SetOnRevive(() => {
                _enemies.ForEach(Destroy);
                _enemies.Clear();
            });

            OnGameInitialized.Invoke();
        }