25 lines
694 B
C#
25 lines
694 B
C#
using System;
|
|
using FishNet.Connection;
|
|
using FishNet.Object;
|
|
using FishNet.Object.Synchronizing;
|
|
using UnityEngine;
|
|
|
|
namespace Players
|
|
{
|
|
public sealed class PlayerNameService : NetworkBehaviour
|
|
{
|
|
public static event Action<NetworkConnection, string> OnPlayerNameChange;
|
|
|
|
private readonly SyncDictionary<NetworkConnection, string> _playerNames = new();
|
|
|
|
private void Awake()
|
|
{
|
|
_playerNames.OnChange += OnPlayerNamesChange;
|
|
}
|
|
|
|
private void OnPlayerNamesChange(SyncDictionaryOperation op, NetworkConnection key, string value, bool asServer)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
} |