Ejemplo n.º 1
0
 static void ShowField(GUISkin skin)
 {
     GUILayout.BeginVertical();
     if (UnitEditor.CheckInit())
     {
         curUnit = UnitEditor.curInfo.curUnit;
         for (int i = 0; i < curUnit.fields.Count; i++)
         {
             GUILayout.BeginHorizontal();
             var variable = curUnit.fields[i];
             OuUIUtility.FormatShowVariable_Exits(ref variable, skin.GetStyle("UnitEditorUnitField"), skin.GetStyle("UnitEditorFieldLabel"));
             OuUIUtility.FormatButton("-", () => { curUnit.fields.Remove(variable);
                                                   i--; });
             GUILayout.EndHorizontal();
         }
         OuUIUtility.FormatButton("添加属性", AddField);
     }
     GUILayout.EndVertical();
 }
Ejemplo n.º 2
0
 public static void BuildNewUnit()
 {
     curInfo.curUnit      = UnitBase.CreateInstance <UnitBase>();
     curInfo.curUnit.Name = curInfo.unitName;
     Save();
 }