//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected override void BuildElements() { Fill = BuildFill(); Canvas = BuildCanvas(); Canvas.SizeY = 3; //TODO: SizeY based on ArcAngle? }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void UpdateWithRect(HoverCanvas pHoverCanvas, HoverShapeRect pShapeRect) { pHoverCanvas.Controllers.Set(HoverCanvas.SizeXName, this); pHoverCanvas.Controllers.Set(HoverCanvas.SizeYName, this); pHoverCanvas.SizeX = pShapeRect.SizeX; pHoverCanvas.SizeY = pShapeRect.SizeY; }
/*--------------------------------------------------------------------------------------------*/ private void UpdateWithArc(HoverCanvas pHoverCanvas, HoverShapeArc pShapeArc) { pHoverCanvas.Controllers.Set(SettingsControllerMap.TransformLocalPosition+".x", this); pHoverCanvas.Controllers.Set(HoverCanvas.SizeXName, this); pHoverCanvas.SizeX = pShapeArc.OuterRadius-pShapeArc.InnerRadius; Vector3 canvasLocalPos = pHoverCanvas.transform.localPosition; canvasLocalPos.x = pShapeArc.InnerRadius+pHoverCanvas.SizeX/2; pHoverCanvas.transform.localPosition = canvasLocalPos; }
/*--------------------------------------------------------------------------------------------*/ private void UpdateChildCanvas(HoverCanvas pChildCanvas, float pAlpha) { if ( pChildCanvas == null ) { return; } pChildCanvas.Controllers.Set(SettingsControllerMap.CanvasSortingLayer, this); pChildCanvas.Controllers.Set(SettingsControllerMap.CanvasGroupAlpha, this); pChildCanvas.CanvasComponent.sortingLayerName = SortingLayer; pChildCanvas.CanvasGroupComponent.alpha = pAlpha; }
/*--------------------------------------------------------------------------------------------*/ private void UpdateIcons(HoverCanvas pHoverCanvas) { var iconOuterType = HoverIcon.IconOffset.None; var iconInnerType = HoverIcon.IconOffset.None; switch ( IconType ) { case IconPairType.Unspecified: break; case IconPairType.CheckboxOn: iconOuterType = HoverIcon.IconOffset.CheckOuter; iconInnerType = HoverIcon.IconOffset.CheckInner; break; case IconPairType.CheckboxOff: iconOuterType = HoverIcon.IconOffset.CheckOuter; break; case IconPairType.RadioOn: iconOuterType = HoverIcon.IconOffset.RadioOuter; iconInnerType = HoverIcon.IconOffset.RadioInner; break; case IconPairType.RadioOff: iconOuterType = HoverIcon.IconOffset.RadioOuter; break; case IconPairType.NavigateIn: iconOuterType = HoverIcon.IconOffset.NavigateIn; break; case IconPairType.NavigateOut: iconOuterType = HoverIcon.IconOffset.NavigateOut; break; case IconPairType.Sticky: iconOuterType = HoverIcon.IconOffset.Sticky; break; case IconPairType.Slider: iconOuterType = HoverIcon.IconOffset.Slider; break; default: throw new Exception("Unhandled icon type: "+IconType); } pHoverCanvas.IconOuter.Controllers.Set(HoverIcon.IconTypeName, this); pHoverCanvas.IconInner.Controllers.Set(HoverIcon.IconTypeName, this); pHoverCanvas.IconOuter.IconType = iconOuterType; pHoverCanvas.IconInner.IconType = iconInnerType; }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ protected override void BuildElements() { Fill = BuildFill(); Canvas = BuildCanvas(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void UpdateLabel(HoverCanvas pHoverCanvas) { pHoverCanvas.Label.Controllers.Set(SettingsControllerMap.TextText, this); pHoverCanvas.Label.TextComponent.text = LabelText; }