Example #1
0
    public void SetType(TypeRegion t)
    {
        type = t;

        switch (type)
        {
        case TypeRegion.PLAYER_SPAWN:
            canSpawnMonster = false;
            canSpawnPlayer  = true;
            canSpawnNest    = false;
            break;

        case TypeRegion.CLOSED:
            canSpawnNest    = false;
            canSpawnPlayer  = false;
            canSpawnMonster = false;
            break;

        case TypeRegion.NORMAL:
            canSpawnMonster = true;
            canSpawnPlayer  = false;
            canSpawnNest    = false;
            break;

        case TypeRegion.NEST:
            canSpawnMonster = true;
            canSpawnPlayer  = false;
            canSpawnNest    = true;
            break;
        }
    }
Example #2
0
    public MapRegion(List <MapTile> t, TypeRegion type = TypeRegion.CLOSED)
    {
        tiles = t;

        centerOfRegion = tiles[Random.Range(0, tiles.Count)].position;

        SetType(type);
    }