Ejemplo n.º 1
0
 public GUIColor(System.Object data, FieldInfo fi) : base(data, fi)
 {
     TextVector = new TextVector((Color)fi.GetValue(data));
     _onGUI     = () => {
         var c = (Color)TextVector.Value;
         GUILayout.BeginVertical();
         GUILayout.BeginHorizontal();
         GUILayout.Label(string.Format("{0} ", fi.Name), GUILayout.ExpandWidth(false));
         var prevColor = UnityEngine.GUI.color;
         UnityEngine.GUI.color = new Color(c.r, c.g, c.b);
         GUILayout.Label("■■■■■■", GUILayout.ExpandWidth(false));
         UnityEngine.GUI.color = new Color(c.a, c.a, c.a);
         GUILayout.Label("■■", GUILayout.ExpandWidth(false));
         UnityEngine.GUI.color = prevColor;
         GUILayout.EndHorizontal();
         GUILayout.BeginHorizontal();
         for (var i = 0; i < 4; i++)
         {
             TextVector[i] = GUILayout.TextField(TextVector[i], GUILayout.ExpandWidth(true), GUILayout.MinWidth(30f));
         }
         GUILayout.EndHorizontal();
         GUILayout.EndVertical();
         Save();
     };
 }
Ejemplo n.º 2
0
 public BaseGUIVector(System.Object data, FieldInfo fi, int dimention) : base(data, fi)
 {
     TextVector = GetTextVector(data, fi);
     _onGUI     = () => {
         GUILayout.BeginHorizontal();
         GUILayout.Label(string.Format("{0} ", fi.Name), GUILayout.ExpandWidth(false));
         for (var i = 0; i < dimention; i++)
         {
             TextVector[i] = GUILayout.TextField(TextVector[i], GUILayout.ExpandWidth(true), GUILayout.MinWidth(30f));
         }
         GUILayout.EndHorizontal();
         Save();
     };
 }