public void RefreshValue() { dictionaryData.RefreshValue(); List <ObjectData> keys = new List <ObjectData>(dictionaryData.elements.Keys); List <EditorObject> editorKeys = new List <EditorObject>(editorElements.Keys); for (int i = 0; i < keys.Count; i++) { ObjectData key = keys[i]; ObjectData value = dictionaryData.elements[key]; if (editorKeys.Count > i) { EditorObject editorKey = editorKeys[i]; EditorObject editorValue = editorElements[editorKey]; editorKey.RefreshValue(key, level, i.ToString() + " key:"); editorValue.RefreshValue(value, level, i.ToString() + " value:"); } else { EditorObject editorKey = new EditorObject(key, level, i.ToString() + " key:"); EditorObject editorValue = new EditorObject(value, level, i.ToString() + " value:"); editorElements.Add(editorKey, editorValue); } } //foreach (var item in dictionaryData.elements) //{ // ObjectData key = item.Key; // ObjectData value = item.Value; // EditorObject editorKey = new EditorObject(key, level, "key:"); // EditorObject editorValue = new EditorObject(value, level, "value:"); // editorElements.Add(editorKey, editorValue); //} }
public void RefreshValue() { arrayData.RefreshValue(); for (int i = 0; i < arrayData.elements.Count; i++) { ObjectData objectData = arrayData.elements[i]; EditorObject editorObjectInfo = null; if (editorElements.TryGetValue(i, out editorObjectInfo) == false) { editorObjectInfo = new EditorObject(objectData, level, i.ToString()); editorElements.Add(i, editorObjectInfo); } else { editorObjectInfo.RefreshValue(objectData, level, i.ToString()); } } }
public static void GUI(EditorField info, string searchKeyword = "", AccessModifier accessModifier = AccessModifier.All, InstanceType instanceType = InstanceType.Instance) { //info.fieldData.RefreshValue();//重要 字段初始化有可能未空 没有引用 if (accessModifier != AccessModifier.All && info.fieldData.accessModifier != accessModifier) { return; } if (instanceType != InstanceType.All && info.fieldData.instanceType != instanceType) { return; } if (searchKeyword != string.Empty && info.name.ToLower().Contains(searchKeyword) == false) { return; } EditorObject.GUI(info.editorObjectInfo); }
public static void GUI(EditorParameter info) { EditorObject.GUI(info.editorObjectInfo); }
void EditorInit() { editorObjectInfo = new EditorObject(parameterData.objectInfo, level, parameterData.name); }