private void Update() { foreach (EnemyMarker marker in enemyMarkers) { if (Vector3.Distance(marker.transform.position, playerTransform.transform.position) < 100f && player.isPlayerAlive) { if (Random.Range(0, 7000) == 10) { _allEnemies.AddEnemy(_enemyFactory.Create(marker.enemyType, marker.transform.position)); } } } }