/*--------------------------------------------------------------------------------------------*/ private void TryUpdateColor(HoverMesh pHoverMesh) { Controllers.Set(SettingsControllerMap.MeshColors, this); Color useColor; switch ( pHoverMesh.DisplayMode ) { case HoverMesh.DisplayModeType.Standard: useColor = StandardColor; break; case HoverMesh.DisplayModeType.SliderFill: useColor = SliderFillColor; break; default: throw new Exception("Unhandled display mode: "+pHoverMesh.DisplayMode); } if ( !pHoverMesh.DidRebuildMesh && Alpha == vPrevAlpha && useColor == vPrevColor ) { return; } Color colorForAllVertices = DisplayUtil.FadeColor(useColor, Alpha); pHoverMesh.Builder.CommitColors(colorForAllVertices); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void UpdateChildMesh(HoverMesh pChildMesh) { HoverAlphaMeshUpdater meshUp = pChildMesh.GetComponent<HoverAlphaMeshUpdater>(); if ( meshUp == null ) { return; } meshUp.Controllers.Set(HoverAlphaMeshUpdater.SortingLayerName, this); meshUp.Controllers.Set(HoverAlphaMeshUpdater.AlphaName, this); meshUp.SortingLayer = SortingLayer; meshUp.Alpha = Alpha; }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void TryUpdateLayer(HoverMesh pHoverMesh) { Controllers.Set(SettingsControllerMap.MeshRendererSortingLayer, this); Controllers.Set(SettingsControllerMap.MeshRendererSortingOrder, this); if ( !pHoverMesh.DidRebuildMesh && SortingLayer == vPrevLayer && SortingOrder == vPrevOrder ) { return; } MeshRenderer meshRend = gameObject.GetComponent<MeshRenderer>(); meshRend.sortingLayerName = SortingLayer; meshRend.sortingOrder = SortingOrder; }