Hi,
I’m having a bit of problem finding out what is wrong with the following control.
What I am trying to accomplish is making navigational buttons which gets active if a valid direction move exist to either N, NE, E, SE, S, SW, W, NW and inactive when not present.
It works perfectly fine, but the issue is when I reach edges of map, the button disappears and then when I move away from edge it comes back…
I know it because List.Contains evaluates false when edge is reached, question is how would draw the button even so
if(movement.pathList.Contains(GameObject.Find("G" + (movement.gridNumber + 1) + " (m" + map.mapNumber + ")").transform) && (movement.yPos % 2 == 1)) {
if(GUI.Button(new Rect(112, 148, but_Width, but_Height), "", nav_SE_Active))
movement.gridNumber += 1;
}
else if(movement.pathList.Contains(GameObject.Find("G" + (movement.gridNumber + 33) + " (m" + map.mapNumber + ")").transform)) {
if(GUI.Button(new Rect(112, 148, but_Width, but_Height), "", nav_SE_Active))
movement.gridNumber += 33;
}
else
GUI.Button(new Rect(112, 148, but_Width, but_Height), "", nav_SE_Inactive);