コード例 #1
0
ファイル: ArcState.cs プロジェクト: seoinin/Hovercast-VR-Menu
        /*--------------------------------------------------------------------------------------------*/
        private void HandleLevelChange(int pDirection)
        {
            vSegments.Clear();

            NavLevel navLevel = vNavProv.GetLevel();

            foreach (NavItem navItem in navLevel.Items)
            {
                var seg = new ArcSegmentState(navItem, vSettings);
                vSegments.Add(seg);
            }

            OnLevelChange(pDirection);
        }
コード例 #2
0
ファイル: ArcState.cs プロジェクト: seoinin/Hovercast-VR-Menu
        /*--------------------------------------------------------------------------------------------*/
        internal void UpdateWithCursor(CursorState pCursor)
        {
            bool    allowSelect = (pCursor.IsActive && DisplayStrength > 0);
            Vector3?cursorPos   = (pCursor.IsActive ? pCursor.Position : (Vector3?)null);

            NearestSegment = null;

            foreach (ArcSegmentState seg in vSegments)
            {
                seg.UpdateWithCursor(cursorPos);

                if (!allowSelect)
                {
                    continue;
                }

                if (NearestSegment == null)
                {
                    NearestSegment = seg;
                    continue;
                }

                if (seg.HighlightDistance < NearestSegment.HighlightDistance)
                {
                    NearestSegment = seg;
                }
            }

            foreach (ArcSegmentState seg in vSegments)
            {
                if (seg.SetAsNearestSegment(seg == NearestSegment))
                {
                    break;
                }
            }
        }