/*--------------------------------------------------------------------------------------------*/ protected override void UpdateFillMesh(HoverMesh pSegmentMesh, SliderUtil.SegmentInfo pSegmentInfo, float pStartPos, float pEndPos) { HoverShapeRect meshShapeRect = pSegmentMesh.GetComponent<HoverShapeRect>(); HoverMeshRect meshRect = (HoverMeshRect)pSegmentMesh; pSegmentMesh.Controllers.Set(SettingsControllerMap.TransformLocalPosition+".x", this); pSegmentMesh.Controllers.Set(SettingsControllerMap.TransformLocalPosition+".y", this); pSegmentMesh.Controllers.Set(HoverMesh.DisplayModeName, this); meshRect.Controllers.Set(HoverMeshRect.UvTopName, this); meshRect.Controllers.Set(HoverMeshRect.UvBottomName, this); meshShapeRect.SizeY = pSegmentInfo.EndPosition-pSegmentInfo.StartPosition; pSegmentMesh.DisplayMode = (pSegmentInfo.IsFill ? HoverMesh.DisplayModeType.SliderFill : HoverMesh.DisplayModeType.Standard); meshRect.UvTop = (UseTrackUv ? Mathf.InverseLerp(pStartPos, pEndPos, pSegmentInfo.StartPosition) : 0); meshRect.UvBottom = (UseTrackUv ? Mathf.InverseLerp(pStartPos, pEndPos, pSegmentInfo.EndPosition) : 1); Vector3 localPos = pSegmentMesh.transform.localPosition; localPos.x = (InsetLeft-InsetRight)/2; localPos.y = (pSegmentInfo.StartPosition+pSegmentInfo.EndPosition)/2; pSegmentMesh.transform.localPosition = localPos; }
/*--------------------------------------------------------------------------------------------*/ protected override void UpdateFillMesh(HoverMesh pSegmentMesh, SliderUtil.SegmentInfo pSegmentInfo, float pStartPos, float pEndPos) { HoverShapeArc meshShapeArc = pSegmentMesh.GetComponent<HoverShapeArc>(); HoverMeshArc meshArc = (HoverMeshArc)pSegmentMesh; pSegmentMesh.Controllers.Set(SettingsControllerMap.TransformLocalRotation, this); pSegmentMesh.Controllers.Set(HoverMesh.DisplayModeName, this); meshArc.Controllers.Set(HoverMeshArc.UvMinArcDegreeName, this); meshArc.Controllers.Set(HoverMeshArc.UvMaxArcDegreeName, this); meshShapeArc.ArcDegrees = pSegmentInfo.EndPosition-pSegmentInfo.StartPosition; pSegmentMesh.DisplayMode = (pSegmentInfo.IsFill ? HoverMesh.DisplayModeType.SliderFill : HoverMesh.DisplayModeType.Standard); meshArc.UvMinArcDegree = (UseTrackUv ? Mathf.InverseLerp(pStartPos, pEndPos, pSegmentInfo.StartPosition) : 0); meshArc.UvMaxArcDegree = (UseTrackUv ? Mathf.InverseLerp(pStartPos, pEndPos, pSegmentInfo.EndPosition) : 1); pSegmentMesh.transform.localRotation = Quaternion.AngleAxis( (pSegmentInfo.StartPosition+pSegmentInfo.EndPosition)/2, Vector3.forward); }
/*--------------------------------------------------------------------------------------------*/ 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); }
/*--------------------------------------------------------------------------------------------*/ 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); }
/*--------------------------------------------------------------------------------------------*/ protected abstract void UpdateTickMesh(HoverMesh pTickMesh, SliderUtil.SegmentInfo pTickInfo);
/*--------------------------------------------------------------------------------------------*/ protected abstract void UpdateFillMesh(HoverMesh pSegmentMesh, SliderUtil.SegmentInfo pSegmentInfo, float pStartPos, float pEndPos);