29 lines
835 B
C#
29 lines
835 B
C#
using NaughtyAttributes;
|
|
using UnityEngine;
|
|
|
|
namespace EscapeRoomEngine.VR.Runtime
|
|
{
|
|
public class Player : MonoBehaviour
|
|
{
|
|
public static Player Current
|
|
{
|
|
get
|
|
{
|
|
if (_foundPlayer == null)
|
|
{
|
|
_foundPlayer = FindObjectOfType<Player>();
|
|
}
|
|
return _foundPlayer;
|
|
}
|
|
}
|
|
private static Player _foundPlayer;
|
|
|
|
[BoxGroup("Internal")] public new Camera camera;
|
|
[BoxGroup("Internal")] [SerializeField] private Transform leftEye, rightEye;
|
|
[BoxGroup("Internal")] [SerializeField] private Collider leftHand, rightHand;
|
|
|
|
public Transform GetEye(Camera.StereoscopicEye eye) =>
|
|
eye == Camera.StereoscopicEye.Left ? leftEye : rightEye;
|
|
}
|
|
}
|