/// <summary> /// 创建垂直按钮列表 /// </summary> public static void CreateVerticalBtnList(List <string> itemList, float width, float height, Action <int> selCallBack, string style = "box") { CreateVertical(style, width, height, () => { for (int i = 0; i < itemList.Count; i++) { string item = itemList[i]; EDButton.CreateBtn(item, width * 0.9f, 25, () => { selCallBack(i); }); } }); }
private void OnGUI() { EDLayout.CreateVertical("box", position.width, position.height, () => { InputStr = EditorGUILayout.TextField("请输入:", InputStr); EditorGUILayout.Space(); EDButton.CreateBtn("确定", position.width * 0.9f, position.height * 0.5f, () => { if (CallBack != null && InputStr != "") { CallBack(InputStr); Close(); } }); }); }