vr ready buttons
This commit is contained in:
28
Assets/VR/Runtime/Player.cs
Normal file
28
Assets/VR/Runtime/Player.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user