48 lines
1.2 KiB
C#
48 lines
1.2 KiB
C#
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 = "...";
|
|
}
|
|
}
|