Unity discourages the use of if statements, as it messes up the branch predictor. I’ve found a workaround to have multiple checks without using an if statement, to convert
if(mapNodeResult.isCover != 1) selectDestination = false;
if(mapNodeResult.isWalkable != 1) selectDestination = false;
if(GridFilter.FilterByBinning(worldCoord, binSize, bins)) selectDestination = false;
into
selectDestination = selectDestination && mapNodeResult.isCover == 1;
selectDestination = selectDestination && mapNodeResult.isWalkable == 1;
selectDestination = selectDestination && GridFilter.FilterByBinning(worldCoord, binSize, bins);
.
However, this seems logically similar to an if-statement - there is an early exit for example if one of the earlier checks return false. Anyone with hardware knowledge can chip in and determine if the second block is more burst-friendly?