示例#1
0
        public override void UpdateHover(InputState input)
        {
            UIRayHit uiHit;

            if (scene.Find2DCockpitUIHoverHit(input.vMouseOrthoWorldRay, out uiHit))
            {
                if (activeHover != null && activeHover != uiHit.hitUI)
                {
                    EndHover(input);
                }

                activeHover = uiHit.hitUI;
                activeHover.UpdateHover(input.vMouseOrthoWorldRay, uiHit);
            }
            else if (activeHover != null)
            {
                EndHover(input);
            }
        }
        public override void UpdateHover(InputState input)
        {
            UIRayHit uiHitL;

            if (input.bLeftControllerActive && scene.FindUIHoverHit(input.vLeftSpatialWorldRay, out uiHitL))
            {
                if (activeLeftHover != null && activeLeftHover != uiHitL.hitUI)
                {
                    deactivate_hover(input, true);
                }

                activeLeftHover = uiHitL.hitUI;
                if (activeLeftHover != activeRightHover)
                {
                    activeLeftHover.UpdateHover(input.vLeftSpatialWorldRay, uiHitL);
                }
            }
            else if (activeLeftHover != null)
            {
                deactivate_hover(input, true);
            }

            UIRayHit uiHitR;

            if (input.bRightControllerActive && scene.FindUIHoverHit(input.vRightSpatialWorldRay, out uiHitR))
            {
                if (activeRightHover != null && activeRightHover != uiHitR.hitUI)
                {
                    deactivate_hover(input, false);
                }

                activeRightHover = uiHitR.hitUI;
                if (activeRightHover != activeLeftHover)
                {
                    activeRightHover.UpdateHover(input.vRightSpatialWorldRay, uiHitR);
                }
            }
            else if (activeRightHover != null)
            {
                deactivate_hover(input, false);
            }
        }