static public void SetLayerTag(string name, string tag) { LayersTagsData lt = GetLayersTagsData(name); if (lt == null || !Tags.Contains(tag)) { return; } lt.tag = tag; }
void ShowLayersTagsDataItemGUI(LayersTagsData item) { GUILayout.BeginVertical("box"); GUILayout.Label("Name: " + item.name); GUILayout.BeginHorizontal(); item.layer = EditorDrawGUIUtil.DrawPopup("Layer", item.layer, AssetsSortManagement.Layers); item.tag = EditorDrawGUIUtil.DrawPopup("Tag", item.tag, AssetsSortManagement.Tags); GUILayout.EndHorizontal(); GUILayout.EndVertical(); }
static public void SetLayer(string name, string layer) { LayersTagsData lt = GetLayersTagsData(name); if (lt == null || !Layers.Contains(layer)) { Debug.Log("Name: " + name + " Data: " + lt + " Layers.Contains(layer):" + Layers.Contains(layer)); return; } lt.layer = layer; }
public LayersTagsData AddNewLayersTagsData(string name, string layer = "None", string tag = "None") { if (ExistInLayersTagsDataList(name)) { return(null); } LayersTagsData lt = new LayersTagsData(name); lt.layer = layer; lt.tag = tag; LayersTagsDataList.Add(lt); return(lt); }
void SetLayersTagsGUI() { pos0 = GUILayout.BeginScrollView(pos0, "box"); EditorDrawFileDirectory.DrawFileDirectory(resFileData, ShowFileDirectoryType.ShowAllFile, null, SelectCallback, true, ChooseCallBack); GUILayout.EndScrollView(); if (chooseItemList.Count > 0) { GUILayout.Label("设置:"); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); selectLayer = EditorDrawGUIUtil.DrawPopup("Layer", selectLayer, AssetsSortManagement.Layers); selectTag = EditorDrawGUIUtil.DrawPopup("Tag", selectTag, AssetsSortManagement.Tags); GUILayout.EndVertical(); if (GUILayout.Button("确定")) { for (int i = 0; i < chooseItemList.Count; i++) { string name = chooseItemList[i].FileNameWithoutExtension; AssetsSortManagement.SetLayerTag(name, selectLayer, selectTag); } } GUILayout.EndHorizontal(); for (int i = 0; i < chooseItemList.Count; i++) { GUILayout.BeginHorizontal(); GUILayout.Label(chooseItemList[i].content); GUILayout.FlexibleSpace(); string name = chooseItemList[i].FileNameWithoutExtension; LayersTagsData lt = AssetsSortManagement.GetLayersTagsData(name); if (lt != null) { GUILayout.Label("Layer: " + lt.layer + " Tag: " + lt.tag); } GUILayout.EndHorizontal(); } } }