need a help! thx
Your question is very broad and does not really provide any information. I will just assume you are asking to retrieve the names of all the user defined layer masks and answer this question:
ArrayList layerNames=new ArrayList();
for(int i=8;i<=31;i++) //user defined layers start with layer 8 and unity supports 31 layers
{
var layerN=LayerMask.LayerToName(i); //get the name of the layer
if(layerN.Length>0) //only add the layer if it has been named (comment this line out if you want every layer)
layerNames.Add(layer)
}
In one line with Linq:
string[] layers = Enumerable.Range(0, 32).Select(index => LayerMask.LayerToName(index)).Where(l => !string.IsNullOrEmpty(l)).ToArray();