UnityEngine.LayerMask.GetMask C# (CSharp) Method

GetMask() public static method

Given a set of layer names as defined by either a Builtin or a User Layer in the, returns the equivalent layer mask for all of them.

public static GetMask ( ) : int
return int
        public static int GetMask(params string[] layerNames)
        {
            if (layerNames == null)
            {
                throw new ArgumentNullException("layerNames");
            }
            int num = 0;
            foreach (string str in layerNames)
            {
                int num3 = NameToLayer(str);
                if (num3 != -1)
                {
                    num |= ((int) 1) << num3;
                }
            }
            return num;
        }
    }