simplified network setup
This commit is contained in:
@ -11,6 +11,8 @@ public class UDPAvatarReceiver : MonoBehaviour
|
||||
{
|
||||
[Header("Network Configuration")]
|
||||
[SerializeField] private int listenPort = 8080;
|
||||
[SerializeField] private bool useGlobalNetworkConfig = true;
|
||||
[SerializeField] private NetworkConfig networkConfigAsset;
|
||||
[SerializeField] private bool enableReceiver = true;
|
||||
[SerializeField] private byte targetPlayerID = 2; // Which player to receive data from (0 = any)
|
||||
[SerializeField] private bool allowPortSharing = true; // For local testing with multiple components
|
||||
@ -85,6 +87,16 @@ public class UDPAvatarReceiver : MonoBehaviour
|
||||
if (targetAvatarRoot == null)
|
||||
targetAvatarRoot = transform;
|
||||
|
||||
// Apply global config if enabled
|
||||
if (useGlobalNetworkConfig)
|
||||
{
|
||||
var cfg = networkConfigAsset != null ? networkConfigAsset : NetworkConfig.Instance;
|
||||
if (cfg != null)
|
||||
{
|
||||
listenPort = cfg.port;
|
||||
}
|
||||
}
|
||||
|
||||
CacheAvatarComponents();
|
||||
|
||||
if (enableReceiver)
|
||||
|
||||
Reference in New Issue
Block a user