Skip to content

Commit

Permalink
-Fix GetOffsetPositionReverse (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuanXin-Unity authored Sep 15, 2021
1 parent e27d208 commit d99b652
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Runtime/Tiles/HexagonalRuleTile/HexagonalRuleTile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,7 @@ public override Vector3Int GetOffsetPosition(Vector3Int position, Vector3Int off
/// <returns>The reversed offset position.</returns>
public override Vector3Int GetOffsetPositionReverse(Vector3Int position, Vector3Int offset)
{
Vector3Int offsetPosition = position - offset;

if (offset.y % 2 != 0 && position.y % 2 != 0)
offsetPosition.x -= 1;

return offsetPosition;
return GetOffsetPosition(position, GetRotatedPosition(offset, 180));
}

/// <summary>
Expand Down

0 comments on commit d99b652

Please sign in to comment.