Пример #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Player" && Helper.distance(transform.position, collision.transform.position) < 1.3f)
     {
         audioSource.Play();
         if (enemyController != null)
         {
             addPoints.Invoke(enemyController.enemiesCount);
         }
         SaveLoadDataController.LoadedData.playerLevel++;
         SaveLoadDataController.SaveData();
         levelPassed.Invoke();
         player.GetComponent <PlayerControler>().CanMove = false;
     }
 }
Пример #2
0
 private void OnDestroy()
 {
     SaveLoadDataController.SaveData();
 }