Example #1
0
        protected override void ApplyHoverState(HoverState newHoverState, bool isStateChange, List <ProximityController> changedControllers)
        {
            foreach (ProximityController interactor in changedControllers)
            {
                if (interactor == null)
                {
                    continue;
                }

                LaserBeamController lbi = interactor.GetComponent <LaserBeamController> ();
                switch (newHoverState)
                {
                case HoverState.Hovered:
                case HoverState.Pressed:
                    if (lbi.hoveredObject != this)
                    {
//						Debug.Log (name + ": Adding hover state for pointer event: " + lbi.name);
                        UILaserInputModule.instance.HandleInputExitAndEnter(lbi.uiLaser.pointerEvent, gameObject);
                        lbi.hoveredObject = this;
                    }
                    break;

                case HoverState.DraggedAway:
                case HoverState.None:
                    if (lbi.hoveredObject == this)
                    {
//						Debug.Log (name + ": Removing hover state for pointer event: " + lbi.name);
                        UILaserInputModule.instance.HandleInputExitAndEnter(lbi.uiLaser.pointerEvent, null);
                        lbi.hoveredObject = null;
                    }
                    break;
                }
            }
        }
Example #2
0
        // Use this for initialization
        void Awake()
        {
            if (lineRenderer == null)
            {
                lineRenderer = GetComponent <LineRenderer> ();
            }
            LaserBeamController interactor = GetComponentInParent <LaserBeamController> ();

            if (interactor != null)
            {
                interactor.OnReticleSet += AdjustLineToReticle;
            }
        }
Example #3
0
        // Use this for initialization
        void Awake()
        {
            if (laserController == null)
            {
                laserController = GetComponentInParent <LaserBeamController>();
            }

            laserController.OnLaserHoverIn  += LaserController_OnLaserHoverIn;
            laserController.OnLaserHoverOut += LaserController_OnLaserHoverOut;
            if (meshRenderer == null)
            {
                meshRenderer = GetComponent <MeshRenderer>();
            }
            meshRenderer.material.color = colorOut;
        }
Example #4
0
 void LaserController_OnLaserHoverOut(LaserBeamController controller, Interactable lastInteractable, Interactable currentInteractable)
 {
     meshRenderer.material.color = colorOut;
     transform.localScale        = Vector3.one * 0.00625f;
 }
Example #5
0
 public virtual float RaycastDistanceAdjustment(LaserBeamController laserController, bool laserDidHit)
 {
     return(0);
 }
Example #6
0
 public virtual float MaxRaycastDistance(LaserBeamController laserController)
 {
     return(-1);
 }
Example #7
0
 public virtual bool RaycastShouldIgnoreLaserHit(LaserBeamController laserController)
 {
     return(false);
 }
Example #8
0
 public virtual bool RaycastShouldUpdateReticlePosition(LaserBeamController laserController, bool laserDidHit)
 {
     return(true);
 }