コード例 #1
0
        /*--------------------------------------------------------------------------------------------*/
        public virtual void Update()
        {
            vMainAlpha = GetArcAlpha(vMenuState) * vAnimAlpha;

            if (!vItemState.Item.IsEnabled || !vItemState.Item.IsAncestryEnabled)
            {
                vMainAlpha *= 0.333f;
            }

            ISelectableItem selItem     = (vItemState.Item as ISelectableItem);
            float           high        = vItemState.MaxHighlightProgress;
            bool            showEdge    = DisplayUtil.IsEdgeVisible(vItemState);
            float           edge        = (showEdge ? high : 0);
            float           select      = 1 - (float)Math.Pow(1 - vItemState.SelectionProgress, 1.5f);
            float           selectAlpha = select;

            if (selItem != null && selItem.IsStickySelected)
            {
                selectAlpha = 1;
            }

            Color colBg   = vSettings.BackgroundColor;
            Color colEdge = vSettings.EdgeColor;
            Color colHigh = vSettings.HighlightColor;
            Color colSel  = vSettings.SelectionColor;

            colBg.a   *= vMainAlpha;
            colEdge.a *= edge * vMainAlpha;
            colHigh.a *= high * vMainAlpha;
            colSel.a  *= selectAlpha * vMainAlpha;

            vHoverSlice.UpdateBackground(colBg);
            vHoverSlice.UpdateEdge(colEdge);
            vHoverSlice.UpdateHighlight(colHigh, high);
            vHoverSlice.UpdateSelect(colSel, select);

            if (vSettings.TextSize != vLabel.FontSize)
            {
                vLabel.SetSize(ArcCanvasThickness * ArcCanvasScale,
                               vSettings.TextSize * 1.5f * ArcCanvasScale, vSettings.TextSize * 0.6f, ArcCanvasScale);
            }

            vLabel.Alpha    = vMainAlpha;
            vLabel.FontName = vSettings.TextFont;
            vLabel.FontSize = vSettings.TextSize;
            vLabel.Color    = vSettings.TextColor;
            vLabel.Label    = vItemState.Item.Label;
        }
コード例 #2
0
        /*--------------------------------------------------------------------------------------------*/
        public virtual void Update()
        {
            vMainAlpha = vPanelState.DisplayStrength * vLayoutState.DisplayStrength;

            if (!vItemState.Item.IsEnabled || !vItemState.Item.IsAncestryEnabled)
            {
                vMainAlpha *= 0.333f;
            }

            ISelectableItem selItem     = (vItemState.Item as ISelectableItem);
            float           high        = vItemState.MaxHighlightProgress;
            bool            showEdge    = DisplayUtil.IsEdgeVisible(vItemState);
            float           edge        = (showEdge ? high : 0);
            float           select      = 1 - (float)Math.Pow(1 - vItemState.SelectionProgress, 1.5f);
            float           selectAlpha = select;

            if (selItem != null && selItem.IsStickySelected)
            {
                selectAlpha = 1;
            }

            Color colBg   = vSettings.BackgroundColor;
            Color colEdge = vSettings.EdgeColor;
            Color colHigh = vSettings.HighlightColor;
            Color colSel  = vSettings.SelectionColor;

            colBg.a   *= vMainAlpha;
            colEdge.a *= edge * vMainAlpha;
            colHigh.a *= high * vMainAlpha;
            colSel.a  *= selectAlpha * vMainAlpha;

            vHoverRect.UpdateBackground(colBg);
            vHoverRect.UpdateEdge(colEdge);
            vHoverRect.UpdateHighlight(colHigh, high);
            vHoverRect.UpdateSelect(colSel, select);

            vLabel.Alpha    = vMainAlpha;
            vLabel.FontName = vSettings.TextFont;
            vLabel.FontSize = vSettings.TextSize;
            vLabel.Color    = vSettings.TextColor;
            vLabel.Label    = vItemState.Item.Label;
        }
コード例 #3
0
        /*--------------------------------------------------------------------------------------------*/
        public virtual void Update()
        {
            float high            = vItemState.MaxHighlightProgress;
            bool  showEdge        = DisplayUtil.IsEdgeVisible(vItemState);
            float edge            = (showEdge ? high : 0);
            float select          = vItemState.SelectionProgress;
            float alpha           = Math.Max(0, 1 - (float)Math.Pow(1 - vMenuState.DisplayStrength, 2));
            float enabledAnimProg = GetEnabledAnimProgress();

            if (vSelItem.IsEnabled && vMenuState.NavBackStrength > select)
            {
                select = vMenuState.NavBackStrength;
                edge   = select;
            }

            select = 1 - (float)Math.Pow(1 - select, 1.5f);

            Color colBg   = vSettings.BackgroundColor;
            Color colEdge = vSettings.EdgeColor;
            Color colHigh = vSettings.HighlightColor;
            Color colSel  = vSettings.SelectionColor;
            Color colIcon = vSettings.ArrowIconColor;

            colBg.a   *= alpha * Mathf.Lerp(0.333f, 1, enabledAnimProg);
            colEdge.a *= edge * alpha;
            colHigh.a *= high * alpha;
            colSel.a  *= select * alpha;
            colIcon.a *= (vItemState.MaxHighlightProgress * 0.75f + 0.25f) * alpha * enabledAnimProg;

            vHoverSlice.UpdateBackground(colBg);
            vHoverSlice.UpdateEdge(colEdge);
            vHoverSlice.UpdateHighlight(colHigh, high);
            vHoverSlice.UpdateSelect(colSel, select);

            vIconMeshBuilder.CommitColors(colIcon);
            vIcon.transform.localScale = Vector3.one * vSettings.TextSize * 0.75f *
                                         UiItemSelectRenderer.ArcCanvasScale;
        }