using UnityEngine; using UnityEditor; using System.Collections; using System.Collections.Generic; public class EditorTools{ static List layers; static string[] layerNames; public static LayerMask LayerMaskField (string label, LayerMask selected) { if (layers == null) { layers = new List(); layerNames = new string[4]; } else { layers.Clear (); } int emptyLayers = 0; for (int i=0;i<32;i++) { string layerName = LayerMask.LayerToName (i); if (layerName != "") { for (;emptyLayers>0;emptyLayers--) layers.Add ("Layer "+(i-emptyLayers)); layers.Add (layerName); } else { emptyLayers++; } } if (layerNames.Length != layers.Count) { layerNames = new string[layers.Count]; } for (int i=0;i