万年素人からHackerへの道

万年素人がHackerになれるまで殴り書きするぜ。

Unity CameraのcullingMaskについて

http://answers.unity3d.com/questions/348974/edit-camera-culling-mask.html

// Turn on the bit using an OR operation:
// →SomeLayerの追加?
private void Show()
{
    camera.cullingMask |= 1 << LayerMask.NameToLayer("SomeLayer");
}
 
// Turn off the bit using an AND operation with the complement of the shifted int:
// →SomeLayerを削除
private void Hide()
{
    camera.cullingMask &=  ~(1 << LayerMask.NameToLayer("SomeLayer"));
}
 
// Toggle the bit using a XOR operation:
// →SomeLayer以外をONかな?
private void Toggle()
{
    camera.cullingMask ^= 1 << LayerMask.NameToLayer("SomeLayer");
}


URL: http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1039319850

1<<0 = 1
1<<1 = 2
1<<2 = 4
1<<3 = 8
1<<4 = 16
1<<5 = 32
1<<6 = 64