Пример #1
0
        /**
         * Find a random spawn group with the correct class and no more than maxCost.
         */
        public GroupInfo GetRandomSpawnGroup(SpawnerClass spawnClass, int maxCost)
        {
            List <GroupInfo> matchingGroups =
                m_spawnGroups.FindAll(g => (g.m_spawnClass == spawnClass) && (g.m_cost <= maxCost));

            return(GetRandomSpawnGroup(matchingGroups));
        }
Пример #2
0
 public GroupInfo()
 {
     m_cost          = 0;
     m_spawnClass    = SpawnerClass.ANY;
     m_spawnType     = SpawnerType.ANY;
     m_spawnGroupDef = null;
 }
Пример #3
0
 public GroupInfo(
     int cost,
     SpawnerClass spawnClass,
     SpawnerType spawnType,
     MySpawnGroupDefinition spawnGroup)
 {
     m_cost          = cost;
     m_spawnClass    = spawnClass;
     m_spawnType     = spawnType;
     m_spawnGroupDef = spawnGroup;
 }
Пример #4
0
    private SpawnerTile chooseSpawner(Vector3Int v)
    {
        //SpawnerClass temp = spawners[r.Next(spawners.Count)];
        SpawnerClass temp     = spawners[r.Next(spawners.Count)];
        Vector3      changedV = floorPillars.gameObject.GetComponentInParent <Grid>().CellToWorld(v) + offset;
        SpawnerTile  t        = (SpawnerTile)ScriptableObject.CreateInstance("SpawnerTile");// SpawnerTile(temp.sprite, temp.spawnedEnemy, genWaves(AvgMobs, waves, spawners.Count), changedV);

        t.sprite         = temp.sprite;
        t.spawnedEnemy   = temp.spawnedEnemy;
        t.wavesTillSpawn = genWaves(AvgMobs, waves, initialSpawnersLeft);
        t.pos            = changedV;
        t.player         = player;
        t.f = this.gameObject;

        return(t);
    }
Пример #5
0
 public SpawnTag(string tagString, SpawnerClass spawnClass, SpawnerType spawnType)
 {
     m_tagString  = tagString;
     m_spawnClass = spawnClass;
     m_spawnType  = spawnType;
 }