コード例 #1
0
    /// <summary>
    /// 取消可选择的Layer
    /// </summary>
    /// <param name="layerList"></param>
    public void CloseSelectionLayer(List <int> layerList)
    {
        EditorObjectSelection editorSelection = EditorObjectSelection.Instance;

        if (editorSelection)
        {
            foreach (var item in layerList)
            {
                int  layerBits = editorSelection.ObjectSelectionSettings.SelectableLayers;
                bool isSet     = LayerHelper.IsLayerBitSet(layerBits, item);
                if (isSet)
                {
                    editorSelection.ObjectSelectionSettings.SelectableLayers = LayerHelper.ClearLayerBit(layerBits, item);
                }
            }
        }
    }