/// <summary> /// 绘制一个单元 /// </summary> /// <param name="labelName"></param> /// <param name="pathStr"></param> /// <param name="btnFolderCallback"></param> /// <param name="btnFileCallback"></param> private void DrewItem(ItemData itemData) { if (itemData == null) { return; } GUILayout.Space(1); GUILayout.BeginHorizontal(); GUILayout.Label(itemData.LabelName, GUILayout.Width(70), GUILayout.Height(20)); GUILayout.FlexibleSpace(); itemData.Path = GUILayout.TextField(itemData.Path, GUILayout.Width(400), GUILayout.Height(20)); GUILayout.FlexibleSpace(); GUI.color = Color.green; if (GUILayout.Button(BtnNameFolder, GUILayout.Height(20)) && itemData.BtnFolderCallback != null) { itemData.BtnFolderCallback(); } GUILayout.FlexibleSpace(); if (!itemData.IsBtnFileActive) { GUI.color = Color.red; } if (GUILayout.Button(BtnNameFile, GUILayout.Height(20)) && itemData.BtnFileCallback != null && itemData.IsBtnFileActive) { itemData.BtnFileCallback(); } GUI.color = Color.white; GUILayout.EndHorizontal(); GUILayout.Space(1); }