public static Unit getSameIdUnit_Towards_onTable(Unit u1, Vector2Int direction, Unit[,] table) { Unit tempUnit = BoardUtilities.getUnitOnTable(u1.CurrentColumn + direction.x, u1.CurrentRow + direction.y, table); if (tempUnit) { if (BoardUtilities.hasSameID(u1, tempUnit)) { return(tempUnit); } } return(null); }