//[MenuItem("Window/Skele/Meta/Set Layer")] public static void RefreshLayers() { // execute setting tag foreach (var monoScript in MonoImporter.GetAllRuntimeMonoScripts()) { if (monoScript.GetClass() == null) { continue; } foreach (var attr in Attribute.GetCustomAttributes(monoScript.GetClass(), typeof(AddLayerAttribute))) { var addLayer = (AddLayerAttribute)attr; var layerName = addLayer.layerName; int slotIdx = addLayer.slotIdx; if (slotIdx >= 0) { TagNLayer.AddLayer(slotIdx, layerName); } else { TagNLayer.TryAddLayer(layerName); } } } }
//[MenuItem("Window/Skele/Meta/Set Tag")] public static void RefreshTags() { // execute setting tag foreach (var monoScript in MonoImporter.GetAllRuntimeMonoScripts()) { if (monoScript.GetClass() == null) { continue; } foreach (var attr in Attribute.GetCustomAttributes(monoScript.GetClass(), typeof(AddTagAttribute))) { var tagName = ((AddTagAttribute)attr).tagName; TagNLayer.AddTag(tagName); } } }