Exemplo n.º 1
0
 public static void TextField(Rect position, Setting <string> value, string label, float offset)
 {
     if (offset > 0f)
     {
         UGUI.Label(position, label, Style.Label);
         position.x     += offset;
         position.width -= offset;
     }
     value.Value = UGUI.TextField(position, value.Value, Style.TextField);
 }
Exemplo n.º 2
0
 public static string TextField(Rect position, string value, string label, float offset)
 {
     if (offset > 0f)
     {
         UGUI.Label(position, label, Style.Label);
         position.x     += offset;
         position.width -= offset;
     }
     return(UGUI.TextField(position, value, Style.TextField));
 }
Exemplo n.º 3
0
 public static void TextField(SmartRect position, Setting <string> value, string label, float offset, bool move = false)
 {
     if (offset > 0f)
     {
         UGUI.Label(position.ToRect(), label, Style.Label);
         position.MoveOffsetX(offset);
     }
     value.Value = UGUI.TextField(position.ToRect(), value.Value, Style.TextField);
     position.ResetX();
     if (move)
     {
         position.MoveY();
     }
 }
Exemplo n.º 4
0
        public static void TextField(Rect position, Setting <int> val, string label, float offset)
        {
            if (offset > 0f)
            {
                UGUI.Label(position, label, Style.Label);
                position.x     += offset;
                position.width -= offset;
            }
            if (!integers.ContainsKey(val))
            {
                integers.Add(val, val.Value.ToString());
            }
            string text = integers[val];

            text = UGUI.TextField(position, text, Style.TextField);
            int.TryParse(text, out val.Value);
            integers[val] = text;
        }
Exemplo n.º 5
0
        public static void TextField(SmartRect position, Setting <int> val, string label, float offset, bool move = false)
        {
            if (offset > 0f)
            {
                UGUI.Label(position.ToRect(), label, Style.Label);
                position.MoveOffsetX(offset);
            }
            if (!integers.ContainsKey(val))
            {
                integers.Add(val, val.Value.ToString());
            }
            string text = integers[val];

            text = UGUI.TextField(position.ToRect(), text, Style.TextField);
            int.TryParse(text, out val.Value);
            integers[val] = text;
            position.ResetX();
            if (move)
            {
                position.MoveY();
            }
        }