mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 22:39:22 +00:00
13 lines
No EOL
542 B
C#
13 lines
No EOL
542 B
C#
using UnityEngine;
|
|
|
|
namespace ABI_RC.Core.Player.Interaction.RaycastImpl
|
|
{
|
|
public class CVRPlayerRaycasterMouse : CVRPlayerRaycaster
|
|
{
|
|
private readonly Camera _camera;
|
|
public CVRPlayerRaycasterMouse(Transform rayOrigin, Camera camera) : base(rayOrigin) { _camera = camera; }
|
|
protected override Ray GetRayFromImpl() => Cursor.lockState == CursorLockMode.Locked
|
|
? new Ray(_camera.transform.position, _camera.transform.forward)
|
|
: _camera.ScreenPointToRay(Input.mousePosition);
|
|
}
|
|
} |