private void SetTileCornerValue(CAssetGrid map, int x, int z, CAssetNode.Corner corner, int value) { CAssetNode tile = map.GetNode(x, z); if (tile == null) { return; } int fv = tile.GetFrogCornerValue(corner); if (fv == value) { return; } tile.SetFrogCornerValue(corner, fv + value); }
public void SmoothTileMapSprite(CAssetGrid tileMap) { //先将corner值都设置为0 for (int x = 0; x < tileMap.NumCols; x++) { for (int z = 0; x < tileMap.NumRows; z++) { CAssetNode tile = tileMap.GetNode(x, z); tile.ResetCornerValue(); } } //再重新计算 for (int x = 0; x < tileMap.NumCols; x++) { for (int z = 0; x < tileMap.NumRows; z++) { SmoothSingleTileSprite(tileMap, x, z); } } }