示例#1
0
 public static void AddVector2Field(string label, out UITextField[] fieldArray, UIHelperExtension parentHelper, Action <Vector2> onChange, bool addRollEvent = true, bool integerOnly = false)
 {
     fieldArray = parentHelper.AddVector2Field(label, Vector3.zero, onChange, integerOnly);
     KlyteMonoUtils.LimitWidthAndBox(fieldArray[0].parent.GetComponentInChildren <UILabel>(), (parentHelper.Self.width / 2) - 10, true);
     if (addRollEvent)
     {
         fieldArray.ForEach(x =>
         {
             if (integerOnly)
             {
                 x.eventMouseWheel += RollInteger;
             }
             else
             {
                 x.eventMouseWheel += RollFloat;
             }
             x.tooltip = Locale.Get("K45_CMNS_FLOAT_EDITOR_TOOLTIP_HELP");
         });
     }
     fieldArray[0].zOrder = 1;
     fieldArray[1].zOrder = 2;
     if (integerOnly)
     {
         fieldArray.ForEach(x => x.allowFloats = false);
     }
 }