Example #1
0
    private void createGrid(int _width, int _height, int lowX, int lowZ)
    {
        levelGrid = new scGrid(_width, _height, lowX, lowZ);

        GameObject[] allWalls   = GameObject.FindGameObjectsWithTag("BaseWall");
        GameObject[] allGrounds = GameObject.FindGameObjectsWithTag("Ground");

        foreach (GameObject aWall in allWalls)
        {
            int index  = (int)(aWall.transform.position.x - lowX);
            int index1 = (int)(aWall.transform.position.z - lowZ);

            levelGrid.setCell(index, index1, 2);
        }

        foreach (GameObject aGround in allGrounds)
        {
            int index  = (int)((aGround.transform.position.x - lowX));
            int index1 = (int)((aGround.transform.position.z - lowZ));

            levelGrid.setCell(index, index1, 1);
        }

        GameObject theHasher = (GameObject)GameObject.FindGameObjectWithTag("CheckCollider");

        theHasher.GetComponent <scCheckCollider>().setWorldGrid(levelGrid);

        foreach (GameObject aWall in allWalls)
        {
            aWall.GetComponent <scWall>().autoTile();
        }
    }
Example #2
0
 public void setWorldGrid(scGrid _worldGrid)
 {
     worldGrid = _worldGrid;
 }
Example #3
0
 public scBSPCorridorDigger(scGrid _level)
 {
     theLevel = _level;
 }