/*--------------------------------------------------------------------------------------------*/ private void UpdateRendererIndicator(HoverRenderer pRenderer, HoverItemHighlightState pHighState, HoverItemSelectionState pSelState) { HoverIndicator rendInd = pRenderer.GetIndicator(); rendInd.Controllers.Set(HoverIndicator.HighlightProgressName, this); rendInd.Controllers.Set(HoverIndicator.SelectionProgressName, this); rendInd.HighlightProgress = pHighState.MaxHighlightProgress; rendInd.SelectionProgress = pSelState.SelectionProgress; }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void UpdateRenderer(HoverRenderer pRenderer, HoverItem pHoverItem) { pRenderer.Controllers.Set(HoverRenderer.IsEnabledName, this); pRenderer.IsEnabled = pHoverItem.Data.IsEnabled; }
/*--------------------------------------------------------------------------------------------*/ private void UpdateRendererCanvas(HoverRenderer pRenderer, HoverItem pHoverItem) { HoverCanvasDataUpdater canvasUp = pRenderer.GetCanvasDataUpdater(); if ( canvasUp == null ) { return; } HoverItemData data = pHoverItem.Data; ICheckboxItemData checkboxData = (data as ICheckboxItemData); IRadioItemData radioData = (data as IRadioItemData); ISelectorItemData selectorData = (data as ISelectorItemData); IStickyItemData stickyData = (data as IStickyItemData); ISliderItemData sliderData = (data as ISliderItemData); var icon = HoverCanvasDataUpdater.IconPairType.Unspecified; if ( checkboxData != null ) { icon = (checkboxData.Value ? HoverCanvasDataUpdater.IconPairType.CheckboxOn : HoverCanvasDataUpdater.IconPairType.CheckboxOff); } else if ( radioData != null ) { icon = (radioData.Value ? HoverCanvasDataUpdater.IconPairType.RadioOn : HoverCanvasDataUpdater.IconPairType.RadioOff); } else if ( selectorData != null ) { if ( selectorData.Action == SelectorActionType.NavigateIn ) { icon = HoverCanvasDataUpdater.IconPairType.NavigateIn; } else if ( selectorData.Action == SelectorActionType.NavigateOut ) { icon = HoverCanvasDataUpdater.IconPairType.NavigateOut; } } else if ( stickyData != null ) { icon = HoverCanvasDataUpdater.IconPairType.Sticky; } else if ( sliderData != null ) { icon = HoverCanvasDataUpdater.IconPairType.Slider; } canvasUp.Controllers.Set(HoverCanvasDataUpdater.LabelTextName, this); canvasUp.Controllers.Set(HoverCanvasDataUpdater.IconTypeName, this); canvasUp.LabelText = (sliderData == null ? data.Label : sliderData.GetFormattedLabel(sliderData)); canvasUp.IconType = icon; }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void UpdateChildRenderer(HoverRenderer pChildRend) { HoverAlphaRendererUpdater rendUp = pChildRend.GetComponent<HoverAlphaRendererUpdater>(); if ( rendUp == null ) { return; } rendUp.Controllers.Set(SortingLayerName, this); rendUp.Controllers.Set(MasterAlphaName, this); rendUp.Controllers.Set(EnabledAlphaName, this); rendUp.Controllers.Set(DisabledAlphaName, this); rendUp.SortingLayer = SortingLayer; rendUp.MasterAlpha = MasterAlpha; rendUp.EnabledAlpha = EnabledAlpha; rendUp.DisabledAlpha = DisabledAlpha; }