//只留当前屏幕显示的几个瓦片,其余全部释放 public void Deactive() { if (!_isActive) { return; } try { TileIdentify[] visibleTiles; LevelDef suitableLevel; _tilesLocator.Compute(_canvas, out suitableLevel, out visibleTiles); if (visibleTiles == null) { return; } foreach (TileIdentify tile in visibleTiles) { TileBitmap tb = _tileCacheManager.Get(suitableLevel.LevelNo, tile.Row, tile.Col); if (tb != null) { _sleepTileCacheManager.Put(tb); _tileCacheManager.Remove(tb); } } } finally { SetToSleep(); _isActive = false; } }
public TileBitmap GetTileBitmap(TileIdentify tile) { return(_tileCacheManager.Get(tile.Level.LevelNo, tile.Row, tile.Col)); }