Пример #1
0
    public void BuildFloor()
    {
        int width  = (int)Mathf.Abs(bottomLeft.x - topRight.x);
        int height = (int)Mathf.Abs(bottomLeft.y - topRight.y);

        for (int x = 0; x < width; x++)
        {
            for (int y = 0; y < height; y++)
            {
                //en haut
                Sprite sprt = db.floor.allConnected;

                if (!tileMan.GetOwnership(bottomLeft + new Vector2Int(x, y)))
                {
                    GameObject gob = new GameObject();
                    gob.AddComponent <SpriteRenderer>();
                    gob.transform.position = db.getTruePosition(bottomLeft + new Vector2Int(x, y));
                    relativePosition[new Vector2Int(x, y)] = new Tuple <GameObject, DatabaseSprite.TypeTile>(gob, DatabaseSprite.TypeTile.FLOOR);
                }
            }
        }
    }