Example #1
0
        /// <summary>
        /// Updates the material.
        /// </summary>
        protected virtual void UpdateMaterial()
        {
            var shader = Utilites.IsHorizontal(slider) ? defaultShaderHorizontal : DefaultShaderVertical;

            if (shader == null)
            {
                return;
            }

            sliderBackground.material = new Material(shader);

            UpdateViewReal();
        }
        /// <summary>
        /// Set specified style.
        /// </summary>
        /// <param name="styleColorPicker">Style for the ColorPicker.</param>
        /// <param name="style">Full style data.</param>
        public virtual void SetStyle(StyleColorPicker styleColorPicker, Style style)
        {
            if ((aSlider != null) && (aSlider.handleRect != null))
            {
                var handle_style = Utilites.IsHorizontal(aSlider)
                                        ? styleColorPicker.SliderVerticalHandle
                                        : styleColorPicker.SliderHorizontalHandle;
                handle_style.ApplyTo(aSlider.handleRect.GetComponent <Image>());
            }

            if (aInput != null)
            {
                aInput.SetStyle(styleColorPicker.InputSpinner, style);
            }
        }
Example #3
0
        /// <summary>
        /// Set the specified style.
        /// </summary>
        /// <returns><c>true</c>, if style was set for children gameobjects, <c>false</c> otherwise.</returns>
        /// <param name="style">Style data.</param>
        public virtual bool SetStyle(Style style)
        {
            if (slider != null)
            {
                var current_style = Utilites.IsHorizontal(slider)
                                        ? style.ColorPickerRangeHorizontal
                                        : style.ColorPickerRangeVertical;
                current_style.Background.ApplyTo(GetComponent <Image>());
                if (slider.handleRect != null)
                {
                    current_style.Handle.ApplyTo(slider.handleRect.GetComponent <Image>());
                }
            }

            return(true);
        }
        /// <summary>
        /// Set the specified style.
        /// </summary>
        /// <param name="styleColorPicker">Style for the ColorPicker.</param>
        /// <param name="style">Style data.</param>
        public virtual void SetStyle(StyleColorPicker styleColorPicker, Style style)
        {
            styleColorPicker.PaletteBorder.ApplyTo(palette.transform.parent.GetComponent <Image>());

            if (paletteCursor != null)
            {
                styleColorPicker.PaletteCursor.ApplyTo(paletteCursor.GetComponent <Image>());
            }

            if ((slider != null) && (slider.handleRect != null))
            {
                var handle_style = Utilites.IsHorizontal(slider)
                                        ? styleColorPicker.SliderVerticalHandle
                                        : styleColorPicker.SliderHorizontalHandle;
                handle_style.ApplyTo(slider.handleRect.GetComponent <Image>());
            }
        }