At line 19, I am getting a leak. Despite not meeting requirements, the method runs thru.
void sortDiagonal_UR(){
print("=======sortDiagonal_UR()==============");
//get limits to xy min max
float xLimit_Max = playerPos.x + 10;
float zLimit_Max = playerPos.z + 10;
float xLimit_Min = playerPos.x - 10;
float zLimit_Min = playerPos.z - 10;
//case UR
for(int i = 0; i < tiles.Length; i++){
//gather new pos
float newX = playerPos.x + (10*i);
float newZ = playerPos.z + (10*i);
Vector3 newPos = new Vector3(newX, tiles[0].transform.position.y, newZ);
///see if newPos is with in the limits
/////!!!!!!!!!!!!!!!!!
///HERE IS THE ISSUE. Despite newX not making this requirements, it leaks thru!!!!!!
if(newX < xLimit_Max && newZ < zLimit_Max || newX > xLimit_Min && newZ > zLimit_Min){
print("========= this newPos is with in limits " + i);
print("=newPos " + newPos);
print("=xLimitMax " + xLimit_Max + " .i" + i);
print("=zLimitMax " + zLimit_Max + " .i" + i);
print("=xLimitMin " + xLimit_Min + " .i" + i);
print("=zLimitMin " + zLimit_Min + " .i" + i);
//run thru tiles again to see if any tile pos matches this new pos
for(int j = 0; j < tiles.Length; j++){
//see if tiles[j].pos = newPos
if(tiles[j].transform.position == newPos){
tiles[j].moveAvailable_rndr.enabled = true;
}
}
}
}
}