ドキュメント

Unity Engine

Unity Engine

Remove a layer from a layerMask

Remove a layer from a layerMask via script.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

To remove a layer from a layermask, use the logical AND operator on the original layermask and the bitwise complement of the layer to remove it.
originalLayerMask &= ~(1 << layerToRemove);

Additional resources