private void AddEnemy(Vector3 center) { if (UnityEngine.Random.Range(0, 10) == 0) { int index = UnityEngine.Random.Range(0, 100) % Enemies.Count; Nation enemy = Instantiate(Enemies[index], EnemyTranform); enemy.transform.position = center + new Vector3(UnityEngine.Random.Range(-size, size), 0.1f, UnityEngine.Random.Range(-size, size)); enemy.transform.eulerAngles = new Vector3(0, UnityEngine.Random.Range(0f, 360f), 0); enemy.transform.localScale = new Vector3(.5f / size, .5f, .5f / size); enemy.gameObject.SetActive(false); NetworkServer.Spawn(enemy.gameObject); Terrain.SpawnPoints.Add(Instantiate(spawnPointsPrefab, center * size - new Vector3(texture.width / 2 * size, 0, texture.height / 2 * size), Quaternion.identity)); NetworkServer.Spawn(Terrain.SpawnPoints[Terrain.SpawnPoints.Count - 1].gameObject); EnemyController.Add(enemy); } }