public override void MakeEditUI(object target) { if (target == null || target as IList == null) { return; } IList list = target as IList; GUILayout.BeginVertical(); if (GUILayout.Button("新建")) { object newo = Activator.CreateInstance(currentConfigType); autoSn(list, newo); list.Add(newo); } for (int i = 0; i < list.Count; i++) { object obj = list[i]; GUILayout.BeginHorizontal(); if (GUILayout.Button(obj.ToString())) { JsonObjectPropertyWindow wp = EditorWindow.GetWindow(typeof(JsonObjectPropertyWindow), false, "属性") as JsonObjectPropertyWindow; wp.SetCurStringInterface(obj, this); } if (GUILayout.Button("删除", GUILayout.Width(80))) { list.Remove(obj); i--; } GUILayout.EndHorizontal(); } GUILayout.EndVertical(); }
protected override void ShowInEditAndPropertyWindow() { base.ShowInEditAndPropertyWindow(); if (CurTypeName == JsonObjectHelperTypes.Config) { JsonObjectPropertyWindow wp = EditorWindow.GetWindow(typeof(JsonObjectPropertyWindow), false, "属性") as JsonObjectPropertyWindow; wp.SetCurStringInterface(null, Helper); } }
void ShowInPropertyWindow() { //显示属性窗口// if (null == wp) { wp = EditorWindow.GetWindow(typeof(JsonObjectPropertyWindow), false, "属性") as JsonObjectPropertyWindow; } wp.Repaint(); wp.SetCurStringInterface(mCurStringInterface, mCurStringInterfaceHelper); }
protected virtual void ShowInEditAndPropertyWindow() { //显示编辑窗口// JsonObjectEditWindow we = EditorWindow.GetWindow(typeof(JsonObjectEditWindow), false, "编辑") as JsonObjectEditWindow; we.Show(); we.SetCurStringInterface(mCurEditingObject, Helper); //显示属性窗口// JsonObjectPropertyWindow wp = EditorWindow.GetWindow(typeof(JsonObjectPropertyWindow), false, "属性") as JsonObjectPropertyWindow; wp.Show(); wp.SetCurStringInterface(mCurEditingObject, Helper); }