Ejemplo n.º 1
0
        public void Initialize(string guid, bool isAlpha, float time, FlexibleColorPicker colorPicker, Action <GradientKey> onKeySelectedCallback, Action <GradientKey> onKeyDeletedCallback, Action onKeyUpdatedCallback)
        {
            _parentRectTransform     = transform.parent.GetComponent <RectTransform>();
            _rectTransform           = GetComponent <RectTransform>();
            _rectTransform.sizeDelta = new Vector2(10, 4);
            _colorPicker             = colorPicker;

            Guid    = guid;
            IsAlpha = isAlpha;
            Time    = time;
            _onKeySelectedCallback = onKeySelectedCallback;
            _onKeyDeletedCallback  = onKeyDeletedCallback;
            _onKeyUpdatedCallback  = onKeyUpdatedCallback;
            _icon.vectorImageData  = isAlpha
                ? MaterialUIIconHelper.GetIcon("CommunityMD", "arrow_down_bold").vectorImageData
                : MaterialUIIconHelper.GetIcon("CommunityMD", "arrow_up_bold").vectorImageData;

            _backgroundIcon.vectorImageData = isAlpha
                ? MaterialUIIconHelper.GetIcon("CommunityMD", "arrow_down_bold").vectorImageData
                : MaterialUIIconHelper.GetIcon("CommunityMD", "arrow_up_bold").vectorImageData;
            SetColor();
        }
Ejemplo n.º 2
0
 public static void ToggleOpenButton(this MaterialButton button, bool isOpen)
 {
     button.iconVectorImageData = (isOpen) ?
                                  MaterialUIIconHelper.GetIcon("Material Design Icons", MaterialIconEnum.KEYBOARD_ARROW_DOWN).vectorImageData :
                                  MaterialUIIconHelper.GetIcon("Material Design Icons", MaterialIconEnum.KEYBOARD_ARROW_RIGHT).vectorImageData;
 }