/*--------------------------------------------------------------------------------------------*/
        public virtual void Update()
        {
            vMainAlpha = UiItemSelectRenderer.GetArcAlpha(vMenuState) * vAnimAlpha;

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

            Color colBg = vSettings.BackgroundColor;

            colBg.a *= vMainAlpha;

            vHoverSlice.UpdateBackground(colBg);

            if (vSettings.TextSize != vLabel.FontSize)
            {
                vLabel.SetSize(
                    UiItemSelectRenderer.ArcCanvasThickness * UiItemSelectRenderer.ArcCanvasScale,
                    vSettings.TextSize * 1.5f * UiItemSelectRenderer.ArcCanvasScale,
                    vSettings.TextSize * 0.6f,
                    UiItemSelectRenderer.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 = UiItemSelectRenderer.GetArcAlpha(vMenuState) * vAnimAlpha;

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

            float easedVal   = GetEasedValue(vSliderItem.Value, vSliderItem.SnappedValue);
            float easedHover = (vSliderItem.HoverValue == null ? easedVal :
                                GetEasedValue((float)vSliderItem.HoverValue, (float)vSliderItem.HoverSnappedValue));
            float hoverArcHalf = 0;

            Color colTrack = vSettings.SliderTrackColor;
            Color colFill  = vSettings.SliderFillColor;
            Color colTick  = vSettings.SliderTickColor;

            colTrack.a *= vMainAlpha;
            colFill.a  *= vMainAlpha;
            colTick.a  *= vMainAlpha;

            vTrackA.UpdateBackground(colTrack);
            vTrackB.UpdateBackground(colTrack);
            vFillA.UpdateBackground(colFill);
            vFillB.UpdateBackground(colFill);
            vTickMat.color = colTick;

            float slideDeg = vSlideDegree0 + vSlideDegrees * easedVal;

            vGrabHold.transform.localRotation = Quaternion.AngleAxis(slideDeg, Vector3.up);

            if (vSliderItem.HoverSnappedValue != null)
            {
                slideDeg = vSlideDegree0 + vSlideDegrees * easedHover;
                vHoverHold.transform.localRotation = Quaternion.AngleAxis(slideDeg, Vector3.up);

                float high   = vItemState.MaxHighlightProgress;
                float select = 1 - (float)Math.Pow(1 - vItemState.SelectionProgress, 1.5f);

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

                colBg.a   *= high * vMainAlpha;
                colHigh.a *= high * vMainAlpha;
                colSel.a  *= select * vMainAlpha;

                vHover.UpdateBackground(colBg);
                vHover.UpdateHighlight(colHigh, high);
                vHover.UpdateSelect(colSel, select);

                hoverArcHalf = vGrabArcHalf * high * 0.333f - UiHoverMeshSlice.AngleInset;
            }

            UpdateMeshes(easedVal, easedHover, hoverArcHalf);
        }
        /*--------------------------------------------------------------------------------------------*/
        public virtual void Update()
        {
            vMainAlpha = UiItemSelectRenderer.GetArcAlpha(vMenuState);

            Color colBg = vSettings.BackgroundColor;

            colBg.a *= vMainAlpha;

            Materials.SetMeshColor(vBackgroundMesh, colBg);

            if (vSettings.TextSize != vLabel.FontSize)
            {
                const float scale = UiItemSelectRenderer.ArcCanvasScale;

                vLabel.SetSize(UiItemSelectRenderer.ArcCanvasThickness * scale,
                               vSettings.TextSize * 1.5f * scale, vSettings.TextSize * 0.6f, scale);
            }

            vLabel.Alpha    = vMainAlpha;
            vLabel.FontName = vSettings.TextFont;
            vLabel.FontSize = vSettings.TextSize;
            vLabel.Color    = vSettings.TextColor;
            vLabel.Label    = vMenuState.GetLevelTitle();
        }
示例#4
0
        /*--------------------------------------------------------------------------------------------*/
        public virtual void Update()
        {
            vMainAlpha = UiItemSelectRenderer.GetArcAlpha(vMenuState) * vAnimAlpha;

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

            const int easePower = 3;
            int       snaps     = vSliderItem.Snaps;
            float     easedVal  = DisplayUtil.GetEasedValue(
                snaps, vSliderItem.Value, vSliderItem.SnappedValue, easePower);
            float easedHover = easedVal;
            float hoverArc   = 0;

            if (vSliderItem.HoverValue != null)
            {
                easedHover = DisplayUtil.GetEasedValue(snaps, (float)vSliderItem.HoverValue,
                                                       (float)vSliderItem.HoverSnappedValue, easePower);
            }

            Color colTrack = vSettings.SliderTrackColor;
            Color colFill  = vSettings.SliderFillColor;
            Color colTick  = vSettings.SliderTickColor;

            colTrack.a *= vMainAlpha;
            colFill.a  *= vMainAlpha;
            colTick.a  *= vMainAlpha;

            vTrack.SetColors(colTrack, colFill);

            if (vTickMeshBuilder != null)
            {
                vTickMeshBuilder.CommitColors(colTick);
            }

            ////

            float slideDeg = vSlideDegree0 + vSlideDegrees * easedVal;

            vGrabHold.transform.localRotation = Quaternion.AngleAxis(slideDeg, Vector3.up);

            if (vSliderItem.HoverValue != null)
            {
                slideDeg = vSlideDegree0 + vSlideDegrees * easedHover;
                vHoverHold.transform.localRotation = Quaternion.AngleAxis(slideDeg, Vector3.up);

                float high   = vItemState.MaxHighlightProgress;
                float select = 1 - (float)Math.Pow(1 - vItemState.SelectionProgress, 1.5f);

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

                colBg.a   *= high * vMainAlpha;
                colHigh.a *= high * vMainAlpha;
                colSel.a  *= select * vMainAlpha;

                vHover.UpdateBackground(colBg);
                vHover.UpdateHighlight(colHigh, high);
                vHover.UpdateSelect(colSel, select);

                hoverArc = vGrabArc * high * HoverBarRelW;
            }

            UpdateMeshes(easedVal, easedHover, hoverArc);
        }