removed legacy avatar synchronization scripts and server implementation, transitioning to a new UDP-based system for improved performance and efficiency
This commit is contained in:
@ -16,10 +16,7 @@ using Newtonsoft.Json;
|
||||
public class VRExperimentController : MonoBehaviour
|
||||
{
|
||||
[Header("Network Settings")]
|
||||
[SerializeField] private int udpPort = 1221;
|
||||
[SerializeField] private bool allowPortSharing = true; // For local testing with multiple components
|
||||
[SerializeField] private bool useGlobalNetworkConfig = true;
|
||||
[SerializeField] private NetworkConfig networkConfigAsset;
|
||||
|
||||
[Header("Avatar Assignments")]
|
||||
[SerializeField] private GameObject helpfulAvatar;
|
||||
@ -40,6 +37,7 @@ public class VRExperimentController : MonoBehaviour
|
||||
private UdpClient udpClient;
|
||||
private Thread udpListenerThread;
|
||||
private bool isListening = false;
|
||||
private int udpPort;
|
||||
|
||||
// Current experiment state
|
||||
private string currentConditionType = "";
|
||||
@ -57,15 +55,18 @@ public class VRExperimentController : MonoBehaviour
|
||||
|
||||
void Start()
|
||||
{
|
||||
// Apply global config if enabled
|
||||
if (useGlobalNetworkConfig)
|
||||
// Get network config from global instance
|
||||
var cfg = NetworkConfig.Instance;
|
||||
if (cfg != null)
|
||||
{
|
||||
var cfg = networkConfigAsset != null ? networkConfigAsset : NetworkConfig.Instance;
|
||||
if (cfg != null)
|
||||
{
|
||||
udpPort = cfg.port;
|
||||
}
|
||||
udpPort = cfg.port;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("NetworkConfig not found! Please ensure NetworkConfig.asset exists in Resources folder.");
|
||||
udpPort = 1221;
|
||||
}
|
||||
|
||||
InitializeObjectMaps();
|
||||
StartUDPListener();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user