Example #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        private void UpdateRenderer(ICursorData pCursorData)
        {
            IdleRenderer.Controllers.Set(HoverRendererIdle.CenterPositionName, this);
            IdleRenderer.Controllers.Set(HoverRendererIdle.DistanceThresholdName, this);
            IdleRenderer.Controllers.Set(HoverRendererIdle.TimerProgressName, this);
            IdleRenderer.Controllers.Set(HoverRendererIdle.IsRaycastName, this);
            IdleRenderer.Controllers.Set(SettingsControllerMap.GameObjectActiveSelf, this);

            IdleRenderer.CenterOffset =
                transform.InverseTransformPoint(pCursorData.Idle.WorldPosition);
            IdleRenderer.DistanceThreshold = pCursorData.Idle.DistanceThreshold;
            IdleRenderer.TimerProgress     = pCursorData.Idle.Progress;
            IdleRenderer.IsRaycast         = pCursorData.IsRaycast;
            RendererUtil.SetActiveWithUpdate(IdleRenderer.gameObject, pCursorData.Idle.IsActive);

            /*Transform itemPointHold = IdleRenderer.Fill.ItemPointer.transform.parent;
             * Transform cursPointHold = IdleRenderer.Fill.CursorPointer.transform.parent;
             *
             * Vector3 itemCenter = GetComponent<HoverRendererUpdater>()
             *      .ActiveRenderer.GetCenterWorldPosition();
             * Vector3 itemCenterLocalPos = IdleRenderer.transform
             *      .InverseTransformPoint(itemCenter);
             * Vector3 cursorLocalPos = IdleRenderer.transform
             *      .InverseTransformPoint(pCursorData.WorldPosition);
             *
             * itemPointHold.localRotation = Quaternion.FromToRotation(Vector3.right, itemCenterLocalPos);
             * cursPointHold.localRotation = Quaternion.FromToRotation(Vector3.right, cursorLocalPos);*/
        }
Example #2
0
        /*--------------------------------------------------------------------------------------------*/
        protected override void ActivateFillMesh(HoverMesh pSegmentMesh)
        {
            HoverShapeRect meshShapeRect = pSegmentMesh.GetComponent <HoverShapeRect>();

            pSegmentMesh.Controllers.Set(SettingsControllerMap.GameObjectActiveSelf, this);

            RendererUtil.SetActiveWithUpdate(pSegmentMesh, (meshShapeRect.SizeY > 0));
        }
Example #3
0
        /*--------------------------------------------------------------------------------------------*/
        private void UpdateActiveStates()
        {
            bool isLabelActive     = (!string.IsNullOrEmpty(Label.TextComponent.text));
            bool isIconOuterActive = (IconOuter.IconType != HoverIcon.IconOffset.None);
            bool isIconInnerActive = (IconInner.IconType != HoverIcon.IconOffset.None);

            RendererUtil.SetActiveWithUpdate(Label, isLabelActive);
            RendererUtil.SetActiveWithUpdate(IconOuter, isIconOuterActive);
            RendererUtil.SetActiveWithUpdate(IconInner, isIconInnerActive);
        }
        /*--------------------------------------------------------------------------------------------*/
        protected virtual void UpdateMeshShape(HoverMesh pMesh, float pSizeX, float pSizeY,
                                               bool pShowMesh = true)
        {
            HoverShapeRect meshShape = pMesh.GetComponent <HoverShapeRect>();

            pMesh.Controllers.Set(SettingsControllerMap.GameObjectActiveSelf, this);
            meshShape.Controllers.Set(HoverShapeRect.SizeXName, this);
            meshShape.Controllers.Set(HoverShapeRect.SizeYName, this);

            RendererUtil.SetActiveWithUpdate(pMesh, (pShowMesh && pMesh.IsMeshVisible));
            meshShape.SizeX = pSizeX;
            meshShape.SizeY = pSizeY;
        }
Example #5
0
        /*--------------------------------------------------------------------------------------------*/
        protected virtual void UpdateMeshShape(HoverMesh pMesh, float pOuterRad, float pInnerRad,
                                               bool pShowMesh = true)
        {
            HoverShapeArc meshShape = pMesh.GetComponent <HoverShapeArc>();

            pMesh.Controllers.Set(SettingsControllerMap.GameObjectActiveSelf, this);
            meshShape.Controllers.Set(HoverShapeArc.OuterRadiusName, this);
            meshShape.Controllers.Set(HoverShapeArc.InnerRadiusName, this);

            RendererUtil.SetActiveWithUpdate(pMesh, (pShowMesh && pMesh.IsMeshVisible));
            meshShape.OuterRadius = pOuterRad;
            meshShape.InnerRadius = pInnerRad;
        }
Example #6
0
        /*--------------------------------------------------------------------------------------------*/
        private void UpdateActiveStates()
        {
            bool isLabelActive     = (!string.IsNullOrEmpty(Label.TextComponent.text));
            bool isIconOuterActive = (IconOuter.IconType != HoverIcon.IconOffset.None);
            bool isIconInnerActive = (IconInner.IconType != HoverIcon.IconOffset.None);

            Label.Controllers.Set(SettingsControllerMap.GameObjectActiveSelf, this);
            IconOuter.Controllers.Set(SettingsControllerMap.GameObjectActiveSelf, this);
            IconInner.Controllers.Set(SettingsControllerMap.GameObjectActiveSelf, this);

            RendererUtil.SetActiveWithUpdate(Label, isLabelActive);
            RendererUtil.SetActiveWithUpdate(IconOuter, isIconOuterActive);
            RendererUtil.SetActiveWithUpdate(IconInner, isIconInnerActive);
        }
        /*--------------------------------------------------------------------------------------------*/
        private void UpdateRenderer(HoverCursorFollower pFollower)
        {
            ICursorData    cursorData = pFollower.GetCursorData();
            HoverIndicator cursorInd  = CursorRenderer.GetIndicator();

            CursorRenderer.Controllers.Set(SettingsControllerMap.GameObjectActiveSelf, this);
            CursorRenderer.Controllers.Set(HoverRendererCursor.IsRaycastName, this);
            CursorRenderer.Controllers.Set(HoverRendererCursor.RaycastWorldOriginName, this);
            cursorInd.Controllers.Set(HoverIndicator.HighlightProgressName, this);
            cursorInd.Controllers.Set(HoverIndicator.SelectionProgressName, this);

            RendererUtil.SetActiveWithUpdate(CursorRenderer, cursorData.IsActive);
            CursorRenderer.IsRaycast          = cursorData.IsRaycast;
            CursorRenderer.RaycastWorldOrigin = cursorData.WorldPosition;
            cursorInd.HighlightProgress       = cursorData.MaxItemHighlightProgress;
            cursorInd.SelectionProgress       = cursorData.MaxItemSelectionProgress;
        }
        /*--------------------------------------------------------------------------------------------*/
        private void UpdateButtons()
        {
            HoverRendererSliderSegments segs = gameObject.GetComponent <HoverRendererSliderSegments>();

            HandleButton.Controllers.Set(HoverRendererButton.IsEnabledName, this);
            JumpButton.Controllers.Set(HoverRendererButton.IsEnabledName, this);
            HandleButton.Fill.Controllers.Set(HoverFillButton.ShowEdgeName, this);
            JumpButton.Fill.Controllers.Set(HoverFillButton.ShowEdgeName, this);

            HandleButton.IsEnabled = IsEnabled;
            JumpButton.IsEnabled   = IsEnabled;

            HandleButton.Fill.ShowEdge = ShowButtonEdges;
            JumpButton.Fill.ShowEdge   = ShowButtonEdges;

            RendererUtil.SetActiveWithUpdate(JumpButton, (AllowJump && segs.IsJumpVisible));
        }
        /*--------------------------------------------------------------------------------------------*/
        protected override void UpdateTickMesh(HoverMesh pTickMesh, SliderUtil.SegmentInfo pTickInfo)
        {
            HoverShapeArc meshShapeArc = pTickMesh.GetComponent <HoverShapeArc>();

            pTickMesh.Controllers.Set(SettingsControllerMap.GameObjectActiveSelf, this);
            pTickMesh.Controllers.Set(SettingsControllerMap.TransformLocalRotation, this);
            meshShapeArc.Controllers.Set(HoverShapeArc.OuterRadiusName, this);
            meshShapeArc.Controllers.Set(HoverShapeArc.InnerRadiusName, this);
            meshShapeArc.Controllers.Set(HoverShapeArc.ArcDegreesName, this);

            meshShapeArc.OuterRadius = vTickOuterRadius;
            meshShapeArc.InnerRadius = vTickInnerRadius;
            meshShapeArc.ArcDegrees  = pTickInfo.EndPosition - pTickInfo.StartPosition;

            pTickMesh.transform.localRotation = Quaternion.AngleAxis(
                (pTickInfo.StartPosition + pTickInfo.EndPosition) / 2, Vector3.forward);

            RendererUtil.SetActiveWithUpdate(pTickMesh, !pTickInfo.IsHidden);
        }
Example #10
0
        /*--------------------------------------------------------------------------------------------*/
        private void UpdateRenderer(HoverCursorFollower pFollower)
        {
            ICursorData    cursorData = pFollower.GetCursorData();
            HoverIndicator cursorInd  = CursorRenderer.GetIndicator();

            CursorRenderer.Controllers.Set(SettingsControllerMap.GameObjectActiveSelf, this);
            CursorRenderer.Controllers.Set(HoverRendererCursor.IsRaycastName, this);
            CursorRenderer.Controllers.Set(HoverRendererCursor.ShowRaycastLineName, this);
            CursorRenderer.Controllers.Set(HoverRendererCursor.RaycastWorldOriginName, this);
            cursorInd.Controllers.Set(HoverIndicator.HighlightProgressName, this);
            cursorInd.Controllers.Set(HoverIndicator.SelectionProgressName, this);

            RendererUtil.SetActiveWithUpdate(CursorRenderer,
                                             (cursorData.IsActive && cursorData.Capability != CursorCapabilityType.None));
            CursorRenderer.IsRaycast       = cursorData.IsRaycast;
            CursorRenderer.ShowRaycastLine = (cursorData.CanCauseSelections &&
                                              cursorData.Type != CursorType.Look);
            CursorRenderer.RaycastWorldOrigin = cursorData.WorldPosition;
            cursorInd.HighlightProgress       = cursorData.MaxItemHighlightProgress;
            cursorInd.SelectionProgress       = cursorData.MaxItemSelectionProgress;
        }
Example #11
0
        /*--------------------------------------------------------------------------------------------*/
        protected override void UpdateTickMesh(HoverMesh pTickMesh, SliderUtil.SegmentInfo pTickInfo)
        {
            HoverShapeRect meshShapeRect = pTickMesh.GetComponent <HoverShapeRect>();

            pTickMesh.Controllers.Set(SettingsControllerMap.GameObjectActiveSelf, this);
            pTickMesh.Controllers.Set(SettingsControllerMap.TransformLocalPosition + ".x", this);
            pTickMesh.Controllers.Set(SettingsControllerMap.TransformLocalPosition + ".y", this);
            meshShapeRect.Controllers.Set(HoverShapeRect.SizeXName, this);
            meshShapeRect.Controllers.Set(HoverShapeRect.SizeYName, this);

            meshShapeRect.SizeX = vTickSizeX;
            meshShapeRect.SizeY = pTickInfo.EndPosition - pTickInfo.StartPosition;

            Vector3 localPos = pTickMesh.transform.localPosition;

            localPos.x = (InsetLeft - InsetRight) / 2;
            localPos.y = (pTickInfo.StartPosition + pTickInfo.EndPosition) / 2;
            pTickMesh.transform.localPosition = localPos;

            RendererUtil.SetActiveWithUpdate(pTickMesh, !pTickInfo.IsHidden);
        }
Example #12
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        private void UpdatePosition()
        {
            if (RaycastLine != null)
            {
                RaycastLine.Controllers.Set(SettingsControllerMap.GameObjectActiveSelf, this);
                RaycastLine.Controllers.Set(HoverRaycastLine.RaycastWorldOriginName, this);

                RaycastLine.RaycastWorldOrigin = RaycastWorldOrigin;
                RendererUtil.SetActiveWithUpdate(RaycastLine, (IsRaycast && ShowRaycastLine));
            }

            if (!Application.isPlaying || !IsRaycast)
            {
                return;
            }

            Controllers.Set(SettingsControllerMap.TransformLocalPosition + ".z", this);

            Vector3 localPos = transform.localPosition;

            localPos.z = RaycastOffsetZ / transform.lossyScale.z;
            transform.localPosition = localPos;
        }
Example #13
0
        /*--------------------------------------------------------------------------------------------*/
        public void TreeUpdate()
        {
            bool isSelected = (
                !UseItemSelectionState ||
                CanvasUpdater.IconType == HoverCanvasDataUpdater.IconPairType.RadioOn ||
                CanvasUpdater.IconType == HoverCanvasDataUpdater.IconPairType.CheckboxOn
                );

            HoverMesh.DisplayModeType dispMode = (isSelected ?
                                                  HoverMesh.DisplayModeType.SliderFill : HoverMesh.DisplayModeType.Standard);

            ////

            HoverShapeRect shapeRect  = GetComponent <HoverShapeRect>();
            float          minOutward = -Mathf.Min(shapeRect.SizeX, shapeRect.SizeY) / 2;

            TabOutward   = Mathf.Max(TabOutward, minOutward);
            TabThickness = Mathf.Max(TabThickness, 0);

            ////

            HoverFillButton hoverFill = GetComponent <HoverFillButton>();
            int             meshCount = hoverFill.GetChildMeshCount();

            for (int i = 0; i < meshCount; i++)
            {
                UpdateChildMesh((HoverMeshRectHollowTab)hoverFill.GetChildMesh(i), dispMode);
            }

            if (isSelected)
            {
                hoverFill.Controllers.Set(HoverFillButton.ShowEdgeName, this);
                hoverFill.ShowEdge = true;
                RendererUtil.SetActiveWithUpdate(hoverFill.Edge, true);
            }
        }
Example #14
0
 /*--------------------------------------------------------------------------------------------*/
 private void UpdateMesh(HoverMesh pMesh)
 {
     pMesh.Controllers.Set(SettingsControllerMap.GameObjectActiveSelf, this);
     RendererUtil.SetActiveWithUpdate(pMesh, pMesh.IsMeshVisible);
 }
Example #15
0
 /*--------------------------------------------------------------------------------------------*/
 private void UpdateMesh(HoverMesh pMesh, bool pShowMesh = true)
 {
     pMesh.Controllers.Set(SettingsControllerMap.GameObjectActiveSelf, this);
     RendererUtil.SetActiveWithUpdate(pMesh, (pShowMesh && pMesh.IsMeshVisible));
 }