Working EyeTracking with moving Hitpoint
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using TMPro;
|
||||
using GhostSystem;
|
||||
|
||||
public class VRDebugger : MonoBehaviour
|
||||
{
|
||||
public TMP_Text trackedObjects;
|
||||
public TMP_Text recording;
|
||||
|
||||
public EyeTrackingCollisionPoints collisionPoints;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
LocalPlayerReference.OnPlayerReady += GetTrackedObjects;
|
||||
GhostRecorderBatch.OnRecord += RecordingStart;
|
||||
GhostRecorderBatch.OnStopRecord += RecordingStop;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
LocalPlayerReference.OnPlayerReady -= GetTrackedObjects;
|
||||
GhostRecorderBatch.OnRecord -= RecordingStart;
|
||||
GhostRecorderBatch.OnStopRecord -= RecordingStop;
|
||||
}
|
||||
|
||||
private void GetTrackedObjects()
|
||||
{
|
||||
GhostRecorderBatch ghostRecorder = FindFirstObjectByType<GhostRecorderBatch>();
|
||||
foreach (var obj in ghostRecorder.TrackedObjects)
|
||||
{
|
||||
trackedObjects.text += "\n\r" + obj;
|
||||
}
|
||||
}
|
||||
|
||||
private void RecordingStart()
|
||||
{
|
||||
recording.color = Color.white;
|
||||
recording.text = "Recording...";
|
||||
}
|
||||
|
||||
private void RecordingStop()
|
||||
{
|
||||
recording.color = Color.white;
|
||||
recording.text = "...";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user