コード例 #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        protected override void BuildElements()
        {
            Fill = BuildFill();
            Canvas = BuildCanvas();

            Canvas.SizeY = 3; //TODO: SizeY based on ArcAngle?
        }
コード例 #2
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        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;
        }
コード例 #3
0
        /*--------------------------------------------------------------------------------------------*/
        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;
        }
コード例 #4
0
        /*--------------------------------------------------------------------------------------------*/
        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;
        }
コード例 #5
0
        /*--------------------------------------------------------------------------------------------*/
        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();
 }
コード例 #7
0
 ////////////////////////////////////////////////////////////////////////////////////////////////
 /*--------------------------------------------------------------------------------------------*/
 private void UpdateLabel(HoverCanvas pHoverCanvas)
 {
     pHoverCanvas.Label.Controllers.Set(SettingsControllerMap.TextText, this);
     pHoverCanvas.Label.TextComponent.text = LabelText;
 }