Example #1
0
        private void Update()
        {
            if (Input.GetMouseButtonUp(0))
            {
                var mousePos    = Input.mousePosition;
                var mouseCamPos = camera.ScreenToWorldPoint(mousePos);
                var ray         = new Ray(mouseCamPos, Vector3.forward);
                var hit         = physicsScene.GetRayIntersection(ray, 1000, inputCastMask);

                Debug.DrawRay(ray.origin, ray.direction * 15, Color.red, 3);

                if (hit.collider != null)
                {
                    StoreSelection(hit.collider.gameObject);
                }
            }
        }