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"));
 }
Beispiel #2
0
 protected internal void DrawLocalLayout(GlobalVariable gv)
 {
     if (gv.structerTypeRange == null)
     {
         return;
     }
     OuUIUtility.FormatFillVariable_SelectedType(ref gv, ref gv.FillIndex);
 }
Beispiel #3
0
        protected internal void DrawFillsLayout(GlobalVariable gv)
        {
            if (gv.structerTypeRange == null)
            {
                throw new NullReferenceException("gv 设置错误");
            }

            gv.isSetVariable = GUILayout.Toggle(gv.isSetVariable, "全局变量?");
            if (gv.isSetVariable)
            {
                OuUIUtility.FormatSelectedVariable_TypeFit(ref gv, ref gv.FillIndex, gv.structerTypeRange);
            }
            else
            {
                OuUIUtility.FormatFillVariable_SelectedType(ref gv, ref gv.FillIndex);
            }
        }
 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);
 }