1 << x essentially says "give me a number, where the (x + 1) -th bit is one, and the rest of the numbers are zero.
x | y x | y is a bitwise OR, so it will go through each bit from 1 to n, and if this bit is one of x or y , then this bit will be one of the results if it is not equal to zero.
So, if LayerMask.NameToLayer("Apple") returns 2 and LayerMask.NameToLayer("Banana") returns 3 , then FRUIT_LAYERS will be the number with 3rd and 4th bits, which is 1100 in binary format, or 12 in the database ten.
Servy source share