Permissions Panel no longer adds duplicates into the player list on first load.

This commit is contained in:
Jamie Greunbaum 2025-12-08 15:56:05 -05:00
parent be83f3a0b2
commit b6921d760a

View File

@ -26,7 +26,7 @@ public class PermissionsPanel : UdonSharpBehaviour
[SerializeField] private UdonBehaviour[] _HostEventListeners = new UdonBehaviour[0];
[SerializeField] private UdonBehaviour[] _CameraEventListeners = new UdonBehaviour[0];
private const int MAX_PLAYERS_IN_LIST = 100;
private const int MAX_PLAYERS_IN_LIST = 85;
void Start()
@ -39,6 +39,8 @@ public class PermissionsPanel : UdonSharpBehaviour
}
public override void OnPlayerJoined(VRCPlayerApi Player)
{
if (Networking.LocalPlayer == Networking.GetOwner(gameObject))
{
for (int i = 0; i < PlayerData_Name.Length; i++)
{
@ -57,11 +59,14 @@ public class PermissionsPanel : UdonSharpBehaviour
RebuildPlayerList();
RequestSerialization();
}
base.OnPlayerJoined(Player);
}
public override void OnPlayerLeft(VRCPlayerApi Player)
{
if (Networking.LocalPlayer == Networking.GetOwner(gameObject))
{
for (int i = 0; i < PlayerData_Name.Length; i++)
{
@ -74,6 +79,7 @@ public class PermissionsPanel : UdonSharpBehaviour
RebuildPlayerList();
RequestSerialization();
}
base.OnPlayerLeft(Player);
}