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

            if (!vSegState.NavItem.IsEnabled)
            {
                vMainAlpha *= 0.333f;
            }

            float showVal = GetEasedValue();

            BuildMesh(vTrackMesh, showVal, 1, false);
            BuildMesh(vFillMesh, 0, showVal, true);

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

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

            vTrack.renderer.sharedMaterial.color = colTrack;
            vFill.renderer.sharedMaterial.color  = colFill;
            vTickMat.color = colTick;

            float slideDeg = vSlideDegree0 + vSlideDegrees * showVal;

            vGrabHold.transform.localRotation = Quaternion.AngleAxis(slideDeg, Vector3.up);
        }
        /*--------------------------------------------------------------------------------------------*/
        public virtual void Update()
        {
            vMainAlpha = UiSelectRenderer.GetArcAlpha(vArcState) * vAnimAlpha;

            if (!vSegState.NavItem.IsEnabled)
            {
                vMainAlpha *= 0.333f;
            }

            float easedVal   = GetEasedValue(vNavSlider.Value, vNavSlider.SnappedValue);
            float easedHover = (vNavSlider.HoverValue == null ? easedVal :
                                GetEasedValue((float)vNavSlider.HoverValue, (float)vNavSlider.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 (vNavSlider.HoverSnappedValue != null)
            {
                slideDeg = vSlideDegree0 + vSlideDegrees * easedHover;
                vHoverHold.transform.localRotation = Quaternion.AngleAxis(slideDeg, Vector3.up);

                float high   = vSegState.HighlightProgress;
                float select = 1 - (float)Math.Pow(1 - vSegState.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 - UiSlice.AngleInset;
            }

            UpdateMeshes(easedVal, easedHover, hoverArcHalf);
        }
Example #3
0
        /*--------------------------------------------------------------------------------------------*/
        public virtual void Update()
        {
            vMainAlpha = UiSelectRenderer.GetArcAlpha(vArcState);

            Color colBg = vSettings.BackgroundColor;

            colBg.a *= vMainAlpha;

            vBackground.renderer.sharedMaterial.color = colBg;

            vLabel.Alpha    = vMainAlpha;
            vLabel.FontName = vSettings.TextFont;
            vLabel.FontSize = vSettings.TextSize;
            vLabel.Color    = vSettings.TextColor;
            vLabel.Label    = vArcState.GetLevelTitle();
        }
        /*--------------------------------------------------------------------------------------------*/
        public void Update()
        {
            SegmentState nearSeg  = vArcState.NearestSegment;
            float        highProg = (nearSeg == null ? 0 : nearSeg.HighlightProgress);
            bool         high     = (highProg >= 1);
            float        thick    = Mathf.Lerp(vSettings.ThickNorm, vSettings.ThickHigh, highProg);
            float        scale    = Mathf.Lerp(vSettings.RadiusNorm, vSettings.RadiusHigh, highProg);

            Color col = (high ? vSettings.ColorHigh : vSettings.ColorNorm);

            col.a *= UiSelectRenderer.GetArcAlpha(vArcState);

            BuildMesh(thick);
            vRingObj.transform.localScale          = Vector3.one * scale;
            vRingObj.renderer.sharedMaterial.color = col;
        }