public void SpawnOrb(float spawnPoints) { Vector3 target = TerrainGen.GetHexPosition(spawnHexes[Random.Range(0, spawnHexes.Count)]); Vector3 spawnPoint = target; spawnPoint.y += TerrainGen.hexSize * coolDownTime; SpawnOrb spawnOrb = GetOrb(); spawnOrb.transform.position = spawnPoint; spawnOrb.SetOrb(target, this, spawnPoints); }
public static void KillOrb(SpawnOrb orb) { if (spawnOrbs.Contains(orb)) { spawnOrbs.Remove(orb); } else { if (!deadSpawnOrbs.Contains(orb)) { deadSpawnOrbs.Add(orb); } } orb.gameObject.SetActive(false); }
public void SpawnFromOrb(SpawnOrb orb, float spawnPoints) { Vector2Int hex = TerrainGen.GetGridPosition2D(orb.transform.position); List <Vector2Int> hexes = TerrainGen.GetHexInRange(hex, 3); string mobType = Mobs.instance.getRandomMob(); mobType = "slime"; while (spawnPoints > 0) { hex = hexes[Random.Range(0, hexes.Count)]; while (TerrainGen.GetHex(hex.x, hex.y) == null) { hex = hexes[Random.Range(0, hexes.Count)]; } SpawnMob(ref spawnPoints, hex, mobType); } KillOrb(orb); }