示例#1
0
        /// <summary>
        /// Casts a world ray using _raycastParams
        /// </summary>
        protected void CastWorldRay()
        {
            if (_isReady)
            {
                _isReady = false;

                #if PLATFORM_LUMIN
                _raycastParams.Position              = Position;
                _raycastParams.Direction             = Direction;
                _raycastParams.UpVector              = Up;
                _raycastParams.Width                 = worldRayProperties.width;
                _raycastParams.Height                = worldRayProperties.height;
                _raycastParams.HorizontalFovDegrees  = worldRayProperties.horizontalFovDegrees;
                _raycastParams.CollideWithUnobserved = worldRayProperties.collideWithUnobserved;

                _ray.origin    = _raycastParams.Position;
                _ray.direction = _raycastParams.Direction;
                #endif

                _modeOnWorldRaycast = mode;

                #if PLATFORM_LUMIN
                if (!MLRaycastStarterKit.Raycast(_raycastParams, HandleOnReceiveRaycast).IsOk)
                {
                    _isReady = true;
                }
                #endif
            }
        }
示例#2
0
 /// <summary>
 /// Starts up component.
 /// </summary>
 protected void Start()
 {
     MLRaycastStarterKit.Start();
     MLEyesStarterKit.Start();
     #if PLATFORM_LUMIN
     #endif
 }
示例#3
0
 /// <summary>
 /// Cleans up component.
 /// </summary>
 protected void OnDestroy()
 {
     MLRaycastStarterKit.Stop();
     MLEyesStarterKit.Stop();
 }