Пример #1
0
    public override bool AttemptSpawn(MazePopulator.PopulationData data)
    {
        Cell cell = GetRandomFreeUnitCell(data);

        MazeUnit enemy = InstantiateInCell(GetUnitPrefab(), cell);

        data.mazeData[cell.x, cell.y].occupant = enemy;

        return(true);
    }
Пример #2
0
    public override bool AttemptSpawn(MazePopulator.PopulationData data)
    {
        if (GetItemLimit() > 0 && itemsSpawned >= GetItemLimit())
        {
            return(false);
        }

        Cell cell = GetRandomFreeItemCell(data);

        Item item = InstantiateInCell(GetItemPrefab(), cell);

        data.mazeData[cell.x, cell.y].item = item;

        itemsSpawned++;

        return(true);
    }