Example #1
0
 public void ChangeCellData(FloorTypes value, int name)
 {
     if (floorCell.ContainsKey(name))
     {
         floorCell[name].floorType = value;
     }
 }
Example #2
0
    public void SetToCell(FloorTypes value, int name, ObstacleTypes obstacleType, FloorAttributes floorAtt)
    {
        FloorCellManage cellManage = new FloorCellManage();

        cellManage.floorType    = value;
        cellManage.obstacleType = obstacleType;
        cellManage.floorAtt     = floorAtt;
        floorCell.Add(name, cellManage);
    }
Example #3
0
    public GameObject CreateFloor(FloorTypes type, Transform parent, Vector3 position)
    {
        GameObject floor = null;

        if (floors.Length > 0)
        {
            floor = SearchResource(floors, (int)type, maxFloorIndex);
            if (floor)
            {
                floor.transform.parent        = parent;
                floor.transform.localPosition = position;
            }
        }
        return(floor);
    }
Example #4
0
    public void InitialiseFloor(float width, float height, float depth, int number, FloorTypes type, int workspaces, int padding)
    {
        // Initialise variables
        floorNo            = number;
        floorSize          = new Vector2(width, depth);
        transform.position = new Vector3(width / 2f, floorNo * height, depth / 2f);
        floorType          = type;
        workspaceCount     = workspaces;
        spacing            = padding;

        // Set wall sizes appropriately
        floorArea.localScale    = new Vector3(width, floorArea.localScale.y, depth);
        floorArea.localPosition = Vector3.zero;
        northWall.localScale    = new Vector3(width * 0.101f, 1, height * 0.1f);
        northWall.localPosition = new Vector3(0, height / 2f, (depth / 2f) + 0.01f);

        southWall.localScale    = new Vector3(width * 0.101f, 1, height * 0.1f);
        southWall.localPosition = new Vector3(0, height / 2f, -((depth / 2f) + 0.01f));

        eastWall.localScale    = new Vector3(depth * 0.101f, 1, height * 0.1f);
        eastWall.localPosition = new Vector3(-((width / 2f) + 0.01f), height / 2f, 0);

        westWall.localScale    = new Vector3(depth * 0.101f, 1, height * 0.1f);
        westWall.localPosition = new Vector3((width / 2f) + 0.01f, height / 2f, 0);

        // Set work area
        int workAreaX, workAreaY, workAreaWidth, workAreaHeight, minX, minY;

        workAreaWidth  = GetRandomFactor(workspaceCount);
        workAreaHeight = workspaceCount / workAreaWidth;
        minX           = Mathf.FloorToInt((width - 1) - (width / 2)) * -1;
        minY           = Mathf.FloorToInt((depth - 1) - (depth / 2));
        //workAreaX = Mathf.FloorToInt(Random.Range(minX, -minX - (workAreaWidth / 2) - (2 * spacing)));
        //workAreaY = Mathf.FloorToInt(Random.Range(minY, -minY + (workAreaHeight / 2) + (2 * spacing)));
        workAreaX = (int)-(floorSize.x * 0.5f - 2f);
        workAreaY = (int)(floorSize.y * 0.5f - 2f);

        SpawnWorkspaces(workAreaX, workAreaY, workAreaWidth, workAreaHeight);

        if (floorNo > 0)
        {
            AddStairHole();
        }
        AddLift();
    }
 public Room(Index2D start, Index2D end, Element theme, FloorTypes f = FloorTypes.Themed, bool move = true)
 {
     StartCell = start;
     EndCell = end;
     FloorType = f;
     Theme = theme;
     Traversable = move;
 }
 public Floor(Index2D start, Index2D end, TileTypes t, Element theme, bool move = true, FloorTypes f = FloorTypes.Themed)
 {
     StartCell = start;
     EndCell = end;
     Type = t;
     Theme = theme;
     Traversable = move;
     FloorType = f;
 }
Example #7
0
 public void SetCurrentWalkEnvironment(FloorTypes newFloor)
 {
     currentFloor = newFloor;
 }