public static LayerMask MappedMaskField(string label, LayerMask current, LayerMask layers) { string[] map; map = layers.MaskToNames(LayerMaskExtension.AllLayerNames()); return(EditorGUILayoutExtension.MappedMaskField(label, current, map)); }
public static LayerMask UserMaskField(string label, LayerMask current) { string[] users; users = LayerMaskExtension.UserLayerMask(); return(EditorGUILayoutExtension.MappedMaskField(label, current, users)); }
public static LayerMask MappedMaskField(string label, LayerMask current, string[] map) { string[] all; LayerMask mask; if (map.Length == 0) { return((LayerMask)0); } all = LayerMaskExtension.AllLayerNames(); // "current" comes from all existing layers -> 'casted' to map specified layers mask = current.CastTo(all, map); // display map specified layers, can select them mask = EditorGUILayout.MaskField(label, mask, map); // "mask" is on map layers -> 'cast' it on all existing layers mask = mask.CastTo(map, all); return(mask); }