public void UpdateBounds() { bound_rect = Rect2.Bounds(towers.Select(x => x.position)); transform = Transform.FromTo(bound_rect, name == "Main" ? new Rect2(0, 0, Constants.map_width, Constants.map_height) : map_tower_rect, true); foreach (Tower tower in towers) { tower.map_position = transform.TransformPoint(tower.position); } }
public void UpdateBounds() { bound_rect = Rect2.Bounds(towers.Select(x => x.position)); transform = Transform.FromTo(bound_rect, map_tower_rect, true); foreach (Tower tower in towers) { tower.map_position = transform.TransformPoint(tower.position); } }