How to assign bits into light.cullingMask (32 bit)

I am trying to set the cullingmask of a light by script like this:

light.cullingMask = 0%00000000000000000010110100000000;

Then Unity/MonoDeveloper states that cullingMask is an Int and that my binary mask is a long?

Error:
Cannot implicitly convert type long' to int’. An explicit conversion exists (are you missing a cast?)

From what I understand there is 32 layers/tags = 32 bits and these has to go into cullingMask.

I’ve tried to cast it:

light.cullingMask = (int) 0%00000000000000000010110100000000;

Error
Cannot implicitly convert type long' to int’. An explicit conversion exists (are you missing a cast?)

  1. Is this a 32-bit vs 64-bit OS problem with Int in Mono?
  2. Is it my way of declaring the binary string/mask?
  3. Can I cast it some other way? Tried with Int32, no luck… huh?

Found a solution, but Damn! I am wondering if this is the only way if I want to stay in binary format.

It seems that in C# you have to “convert from a number string”.

Like this:
light.cullingMask = System.Convert.ToInt32(“00000000000000000010110100000000”,2);

The ,2 in the end, tells the Convert function that this is a 2-digital numbersystem (eg. binary).

Note:
Ofcause I could use hex instead or perhaps make it with Enums and bit-shifting (<< >>) but. I know the bit-flags, so I preferer to put them in with a long 32 bit string.