Consider that I have an 8 bit number, let’s say 00101101, and I want to check whether the third bit from the right is one or zero.
I imagine could do ( 00101101 AND 00000100 ), and if the result is anything other than zero I would know that bit 3’s value is one.
Is there a way to do this in Unity? Is there a different way than the one I’m proposing?
I imagine this must be very simple, but I can’t find any reference in the docs.
Thanks!
P.S. The reason I’m doing this is for a tiling system. I need to adjust some mesh colliders based on their surroundings. Without this kind of binary comparison the code is becoming too unwieldy, very long and with tons of special cases. I believe I can simplify things a bit if this is possible.