Пример #1
0
    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);
    }
Пример #2
0
 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);
 }
Пример #3
0
    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);
    }