Beispiel #1
0
    private void Die()
    {
        audioSource.clip = dieSound;
        audioSource.Play();
        if (addPoints != null)
        {
            addPoints.Invoke(Mathf.CeilToInt(actualUnitStatistic.MaxHP / 2f));
        }

        if (playerDied != null)
        {
            playerDied.Invoke();
            SaveLoadDataController.ClearData();
        }

        DropLoot();

        dead = true;
        gameObject.SetActive(false);
    }
Beispiel #2
0
 public void ResetGame()
 {
     SaveLoadDataController.ClearData();
     SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
 }