private void GetPlayers(List<NetworkingPlayer> players)
{
Network.Unity.MainThreadManager.Run(() =>
{
// Note: This is not optimal, it is just for the idea
foreach (KeyValuePair<ulong, SimpleNetworkedMonoBehavior> kv in networkedBehaviors)
{
if (kv.Value is ForgeExample_Move)
{
foreach (NetworkingPlayer player in players)
{
if (kv.Value.OwnerId == player.NetworkId)
{
((ForgeExample_Move)kv.Value).nameMesh.text = !string.IsNullOrEmpty(player.Name) ? player.Name : "Client";
break;
}
}
}
}
});
}