Esempio n. 1
0
    private void Initialize()
    {
        var dim = 2 * MapRadius + 1;

        InitCells(dim, dim);
        Width             = dim * UNITS_PER_TILE;
        Height            = dim * UNITS_PER_TILE;
        _spriteDictionary = new LRUSpriteDictionary((dim + 1) * (dim + 1));
        _renderGrid       = new RenderGrid(_cells.ToArray(), dim, dim);
        _loadedPosition   = new ProjectedPosition(MapRadius, MapRadius, ZoomLevel, 0, 0);
        _position         = new Vector3();
    }
Esempio n. 2
0
 void Awake()
 {
     if (Root == null)
         Root = transform;
     int dim = 2 * MapRadius + 1;
     InitCells(dim, dim);
     Width = dim * UnitsPerTile;
     Height = dim * UnitsPerTile;
     Dict = new LRUSpriteDictionary((dim + 1) * (dim + 1));
     Grid = new SmartGrid<RenderCell, RefCountedSprite>(Cells.ToArray(), dim, dim);
     _loadedPosition = new MapUtils.ProjectedPos(MapRadius, MapRadius, ZoomLevel, 0, 0);
     _position = new Vector3();
 }