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?)
- Is this a 32-bit vs 64-bit OS problem with Int in Mono?
- Is it my way of declaring the binary string/mask?
- Can I cast it some other way? Tried with Int32, no luck… huh?