Ejemplo n.º 1
0
        public System.Action GenerateGUIColor(FieldInfo fi)
        {
            var textVector = new TextVector((Color)fi.GetValue(data));

            return(() => {
                var c = (Color)textVector.Value;
                GUILayout.BeginVertical();
                GUILayout.BeginHorizontal();
                GUILayout.Label(string.Format("{0} ", fi.Name), GUILayout.ExpandWidth(false));
                var prevColor = GUI.color;
                GUI.color = new Color(c.r, c.g, c.b);
                GUILayout.Label("■■■■■■", GUILayout.ExpandWidth(false));
                GUI.color = new Color(c.a, c.a, c.a);
                GUILayout.Label("■■", GUILayout.ExpandWidth(false));
                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();
                fi.SetValue(data, (Color)textVector.Value);
            });
        }
Ejemplo n.º 2
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 = GUI.color;
         GUI.color = new Color(c.r, c.g, c.b);
         GUILayout.Label("■■■■■■", GUILayout.ExpandWidth(false));
         GUI.color = new Color(c.a, c.a, c.a);
         GUILayout.Label("■■", GUILayout.ExpandWidth(false));
         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.º 3
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();
				};
			}
Ejemplo n.º 4
0
        public System.Action GenerateGUIVector4(FieldInfo fi)
        {
            var textVector = new TextVector((Vector4)fi.GetValue(data));

            return(() => {
                GUILayout.BeginHorizontal();
                GUILayout.Label(string.Format("{0} ", fi.Name), GUILayout.ExpandWidth(false));
                for (var i = 0; i < 4; i++)
                {
                    textVector [i] = GUILayout.TextField(textVector [i], GUILayout.ExpandWidth(true), GUILayout.MinWidth(30f));
                }
                GUILayout.EndHorizontal();
                fi.SetValue(data, textVector.Value);
            });
        }
Ejemplo n.º 5
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 = GUI.color;
         GUI.color = new Color(c.r, c.g, c.b);
         GUILayout.Label("■■■■■■", GUILayout.ExpandWidth(false));
         GUI.color = new Color(c.a, c.a, c.a);
         GUILayout.Label("■■", GUILayout.ExpandWidth(false));
         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.º 6
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();
     };
 }