using GhostSystem; using NUnit.Framework; using System.Collections.Generic; using Unity.Netcode; using UnityEngine; public class LocalPlayerReference : NetworkBehaviour { public static LocalPlayerReference Instance { get; private set; } public List myObjects; public override void OnNetworkSpawn() { if (IsOwner) { Instance = this; Debug.Log("[LocalPlayerReference] Lokaler Spieler registriert."); // Optional: Liste von Transforms vorbereiten GhostRecorderBatch ghostRecorder = FindFirstObjectByType(); if (ghostRecorder != null) { foreach (Transform obj in myObjects) { ghostRecorder.TrackedObjects.Add(obj); } } } } private void OnDestroy() { if (IsOwner && Instance == this) { Instance = null; } } }