Exemplo n.º 1
0
 UIVector DrawTextFields(UIVector data)
 {
     data.StrX = GUILayout.TextField(data.StrX, _textFieldWidth);
     data.StrY = GUILayout.TextField(data.StrY, _textFieldWidth);
     data.StrZ = GUILayout.TextField(data.StrZ, _textFieldWidth);
     data.StrW = GUILayout.TextField(data.StrW, _textFieldWidth);
     return(data);
 }
Exemplo n.º 2
0
        public void InitOnce(string title, Vector4 value, Type flags, Vector4 min, Vector4 max, GUILayoutOption textFieldWidth)
        {
            if (_initialized != 0)
            {
                return;
            }
            _initialized = 1;
            _flags       = flags;

            this._title          = title;
            this.Data            = new UIVector(value);
            this._min            = min;
            this._max            = max;
            this._textFieldWidth = textFieldWidth;
        }
Exemplo n.º 3
0
        public Vector4 Draw()
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label(_title);
            if ((_flags & Type.IsColor) != 0)
            {
                var prevColor = UnityEngine.GUI.color;
                UnityEngine.GUI.color = Data.Value;
                GUILayout.Label("●▲■");
                UnityEngine.GUI.color = prevColor;
            }
            Data = DrawTextFields(Data);
            GUILayout.EndHorizontal();

            if ((_flags & Type.WithSlider) != 0)
            {
                Data.Value = DrawSliders(Data.Value);
            }
            return(Data.Value);
        }
Exemplo n.º 4
0
 UIVector DrawTextFields(UIVector data)
 {
     data.StrX = GUILayout.TextField (data.StrX, _textFieldWidth);
     data.StrY = GUILayout.TextField (data.StrY, _textFieldWidth);
     data.StrZ = GUILayout.TextField (data.StrZ, _textFieldWidth);
     data.StrW = GUILayout.TextField (data.StrW, _textFieldWidth);
     return data;
 }
Exemplo n.º 5
0
        public void InitOnce(string title, Vector4 value, Type flags, Vector4 min, Vector4 max, GUILayoutOption textFieldWidth)
        {
            if (_initialized != 0)
                return;
            _initialized = 1;
            _flags = flags;

            this._title = title;
            this.Data = new UIVector(value);
            this._min = min;
            this._max = max;
            this._textFieldWidth = textFieldWidth;
        }
Exemplo n.º 6
0
        public Vector4 Draw()
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label(_title);
            if ((_flags & Type.IsColor) != 0) {
                var prevColor = UnityEngine.GUI.color;
                UnityEngine.GUI.color = Data.Value;
                GUILayout.Label("●▲■");
                UnityEngine.GUI.color = prevColor;
            }
            Data = DrawTextFields(Data);
            GUILayout.EndHorizontal();

            if ((_flags & Type.WithSlider) != 0)
                Data.Value = DrawSliders(Data.Value);
            return Data.Value;
        }