private static void DrawTreeNodeVariable() { GUILayout.Label("---全局变量库---", skin.GetStyle("adjustBodyLabel")); for (int i = 0; i < NodeEditor.curNodeGraph.GlobalVariablesCount; i++) { GUILayout.BeginHorizontal(); var readGlobalVariable = NodeEditor.curNodeGraph.ReadGlobalVariable(i); OuUIUtility.FormatShowVariable_Exits(ref readGlobalVariable); //GUILayout.Label(NodeEditor.curNodeGraph.globalVariables[i].Value.obj.ToString()); OuUIUtility.FormatButton("-", () => { NodeEditor.curNodeGraph.RemoveGlobalVariable(i); i--; }); GUILayout.EndHorizontal(); } obj.setRangeType(NodeEditor.curNodeGraph); Unitobj.setRangeType(NodeEditor.curNodeGraph, "Unit"); GUILayout.Label("---添加变量---", skin.GetStyle("adjustBodyLabel")); GUILayout.Label("变量名:"); OuUIUtility.FormatTextfield(ref objname); GUILayout.Label("变量种类:"); OuUIUtility.FormatFillVariable_SelectedType(ref obj, ref FillIndex, objname, true); OuUIUtility.FormatButton("添加", AddVariable); OuUIUtility.FormatFillVariable_SelectedType(ref Unitobj, ref Unitobj.FillIndex, "ImportUnitData", true); OuUIUtility.FormatButton("导入Unit", ImportUnitData); GUILayout.Space(20); OuUIUtility.FormatButton("返回", () => { drawIdentity = "Normal"; }, skin.GetStyle("adjustBodyButton")); }
public static void FormatShowVariable_Exits(ref GlobalVariable obj) { OuUIUtility.FormatTextfield(ref obj.name); // OuUIUtility.FormatLabel(obj.identity); OuUIUtility.FormatFillVariable_SelectedType(ref obj, ref obj.FillIndex, obj.name, true); }
public static void FormatShowVariable_Exits(ref GlobalVariable obj, GUIStyle style, GUIStyle style2) { OuUIUtility.FormatLabel("属性名", style2); OuUIUtility.FormatTextfield(ref obj.name, style); OuUIUtility.FormatFillVariable_SelectedType(ref obj, ref obj.FillIndex, obj.name, true); }