//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ internal void Build(IHoverboardPanelState pPanelState, IHoverboardLayoutState pLayoutState, BaseItemState pItemState, IItemVisualSettings pVisualSettings) { vPanelState = pPanelState; vItemState = pItemState; vSlideX0 = 0.5f; vSlideZ0 = 0.5f; vSlideW = vItemState.Item.Width-vSlideX0*2; vSlideH = vItemState.Item.Height-vSlideZ0*2; vIsVert = (vItemState.Item.Height > vItemState.Item.Width); //// vRendererObj = new GameObject("Renderer"); vRendererObj.transform.SetParent(gameObject.transform, false); vRenderer = (IUiItemRenderer)vRendererObj.AddComponent(pVisualSettings.Renderer); vRenderer.Build(pPanelState, pLayoutState, vItemState, pVisualSettings); vRenderer.SetDepthHint(vPanelState.DisplayDepthHint); vPrevDepth = vPanelState.DisplayDepthHint; vItemState.HoverPointUpdater = vRenderer.UpdateHoverPoints; gameObject.transform.localPosition = Vector3.zero; gameObject.transform.localRotation = Quaternion.identity; gameObject.transform.localScale = Vector3.one; }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ internal void Build(MenuState pMenuState, BaseItemState pItemState, float pArcAngle, IItemVisualSettings pVisualSettings) { vMenuState = pMenuState; vItemState = pItemState; ArcAngle = pArcAngle; const float pi = (float)Math.PI; const float slideBufferAngle = pi / 80f; vSlideDegrees = (pArcAngle - slideBufferAngle * 2) / (float)Math.PI * 180; vSlideDir0 = MeshUtil.GetRingPoint(1, -pArcAngle / 2f + slideBufferAngle); //// vRendererObj = new GameObject("Renderer"); vRendererObj.transform.SetParent(gameObject.transform, false); vRenderer = (IUiItemRenderer)vRendererObj.AddComponent(pVisualSettings.Renderer); vRenderer.Build(vMenuState, vItemState, pArcAngle, pVisualSettings); vRenderer.SetDepthHint(vMenuState.DisplayDepthHint); vPrevDepth = vMenuState.DisplayDepthHint; vItemState.HoverPointUpdater = vRenderer.UpdateHoverPoints; }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ internal void Build(IHoverboardPanelState pPanelState, IHoverboardLayoutState pLayoutState, BaseItemState pItemState, IItemVisualSettings pVisualSettings) { vPanelState = pPanelState; vItemState = pItemState; vSlideX0 = 0.5f; vSlideZ0 = 0.5f; vSlideW = vItemState.Item.Width - vSlideX0 * 2; vSlideH = vItemState.Item.Height - vSlideZ0 * 2; vIsVert = (vItemState.Item.Height > vItemState.Item.Width); //// vRendererObj = new GameObject("Renderer"); vRendererObj.transform.SetParent(gameObject.transform, false); vRenderer = (IUiItemRenderer)vRendererObj.AddComponent(pVisualSettings.Renderer); vRenderer.Build(pPanelState, pLayoutState, vItemState, pVisualSettings); vRenderer.SetDepthHint(vPanelState.DisplayDepthHint); vPrevDepth = vPanelState.DisplayDepthHint; vItemState.HoverPointUpdater = vRenderer.UpdateHoverPoints; gameObject.transform.localPosition = Vector3.zero; gameObject.transform.localRotation = Quaternion.identity; gameObject.transform.localScale = Vector3.one; }
/*--------------------------------------------------------------------------------------------*/ public virtual void Update() { if (vMenuState.DisplayDepthHint != vPrevDepth) { vRenderer.SetDepthHint(vMenuState.DisplayDepthHint); vPrevDepth = vMenuState.DisplayDepthHint; } TryUpdateSliderValue(); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ internal void Build(MenuState pMenuState, BaseItemState pItemState, float pArcAngle, IItemVisualSettings pVisualSettings) { vMenuState = pMenuState; vItemState = pItemState; ArcAngle = pArcAngle; const float pi = (float)Math.PI; const float slideBufferAngle = pi/80f; vSlideDegrees = (pArcAngle-slideBufferAngle*2)/(float)Math.PI*180; vSlideDir0 = MeshUtil.GetRingPoint(1, -pArcAngle/2f+slideBufferAngle); //// vRendererObj = new GameObject("Renderer"); vRendererObj.transform.SetParent(gameObject.transform, false); vRenderer = (IUiItemRenderer)vRendererObj.AddComponent(pVisualSettings.Renderer); vRenderer.Build(vMenuState, vItemState, pArcAngle, pVisualSettings); vRenderer.SetDepthHint(vMenuState.DisplayDepthHint); vPrevDepth = vMenuState.DisplayDepthHint; vItemState.HoverPointUpdater = vRenderer.UpdateHoverPoints; }