using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace Assets.Scripts.Managers
{
    public class LayersManager : MonoBehaviour
    {
        public static void ShowLayer(string layerName)
        {
            Camera.main.cullingMask |= (1 << LayerMask.NameToLayer(layerName));
        }

        public static void HideLayer(string layerName)
        {
            Camera.main.cullingMask &= ~(1 << LayerMask.NameToLayer(layerName));
        }

		public static int GetLayerMask (params string[] layers)
	    {
	        int result = 0;
	        foreach (string layer in layers)
	        {
	            int layerMask = (1 << LayerMask.NameToLayer(layer));
	            result |= layerMask;
	        }

	        return result;
	    }
    }
}
