Exemplo n.º 1
0
        /// <summary>
        /// Returns the direction that the camera is looking.
        /// </summary>
        /// <param name="lookPoint">The reference point to compute the direction from.</param>
        /// <param name="raycastLookDistance">Should the raycast look distance be used?</param>
        /// <returns>The direction that the camera is looking.</returns>
        public Vector3 SharedMethod_TargetLookDirectionLookPoint(Vector3 lookPoint, bool raycastLookDistance)
        {
            // The SharedMethod may be called before Start is called.
            if (m_ViewMode == null)
            {
                SharedManager.InitializeSharedFields(Utility.FindCamera(gameObject).gameObject, this);
            }

            return(CameraMonitor.TargetLookDirection(m_CameraTargetLookRay, lookPoint, m_CameraTargetLock, m_CameraRecoil, m_CameraLookDistance, m_ViewMode.Get()));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Returns the direction that the camera is looking. An example of where this is used include when the GUI needs to determine if the crosshairs is looking at any enemies.
 /// </summary>
 /// <param name="applyRecoil">Should the target ray take into account any recoil?</param>
 /// <returns>A ray in the direction that the camera is looking.</returns>
 private Vector3 SharedMethod_TargetLookDirection(bool applyRecoil)
 {
     return(CameraMonitor.TargetLookDirection(m_CameraTargetLookRay, m_CameraTargetLock, applyRecoil ? m_CameraRecoil : 0));
 }