Files
2025-10-02 00:07:11 +02:00

54 lines
1.4 KiB
C#

using UnityEngine;
using UnityEngine.UI;
using TMPro;
using GhostSystem;
// Dieses Skript wurde nur zu Debug-Zwecken verwendet, um zu sehen, ob auch alle gewünschten Objekte getrackt wurden.
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 Start() // Nur für Offline Mode
{
GetTrackedObjects();
}
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 = "...";
}
}