Started rework on the permissions panel.
This commit is contained in:
parent
d49fbdf827
commit
5f84efb6c7
@ -44,25 +44,25 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 3
|
Data: 7
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data:
|
Data:
|
||||||
- Name: $k
|
- Name: $k
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: _ListContainer
|
Data: PlayerData_Name
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: _ListContainer
|
Data: PlayerData_Name
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 3|System.RuntimeType, mscorlib
|
Data: 3|System.RuntimeType, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: UnityEngine.RectTransform, UnityEngine.CoreModule
|
Data: System.String[], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
@ -73,14 +73,14 @@ MonoBehaviour:
|
|||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 6
|
Entry: 3
|
||||||
Data:
|
Data: 1
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
- Name: <IsSerialized>k__BackingField
|
- Name: <IsSerialized>k__BackingField
|
||||||
Entry: 5
|
Entry: 5
|
||||||
Data: true
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 4|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
@ -89,7 +89,7 @@ MonoBehaviour:
|
|||||||
Data: 1
|
Data: 1
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 5|UnityEngine.SerializeField, UnityEngine.CoreModule
|
Data: 5|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
@ -110,19 +110,19 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: $k
|
- Name: $k
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: _PlayerItemTemplate
|
Data: PlayerData_ID
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: _PlayerItemTemplate
|
Data: PlayerData_ID
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 7|System.RuntimeType, mscorlib
|
Data: 7|System.RuntimeType, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: UnityEngine.GameObject, UnityEngine.CoreModule
|
Data: System.Int32[], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
@ -133,14 +133,14 @@ MonoBehaviour:
|
|||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 6
|
Entry: 3
|
||||||
Data:
|
Data: 1
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
- Name: <IsSerialized>k__BackingField
|
- Name: <IsSerialized>k__BackingField
|
||||||
Entry: 5
|
Entry: 5
|
||||||
Data: true
|
Data: false
|
||||||
- Name: _fieldAttributes
|
- Name: _fieldAttributes
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 8|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
@ -149,7 +149,7 @@ MonoBehaviour:
|
|||||||
Data: 1
|
Data: 1
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 9|UnityEngine.SerializeField, UnityEngine.CoreModule
|
Data: 9|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
@ -170,19 +170,19 @@ MonoBehaviour:
|
|||||||
Data:
|
Data:
|
||||||
- Name: $k
|
- Name: $k
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: PlayerData
|
Data: PlayerData_Admin
|
||||||
- Name: $v
|
- Name: $v
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
- Name: <Name>k__BackingField
|
- Name: <Name>k__BackingField
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: PlayerData
|
Data: PlayerData_Admin
|
||||||
- Name: <UserType>k__BackingField
|
- Name: <UserType>k__BackingField
|
||||||
Entry: 7
|
Entry: 7
|
||||||
Data: 11|System.RuntimeType, mscorlib
|
Data: 11|System.RuntimeType, mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 1
|
Entry: 1
|
||||||
Data: VRC.SDK3.Data.DataDictionary, VRCSDK3
|
Data: System.Boolean[], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
@ -193,8 +193,8 @@ MonoBehaviour:
|
|||||||
Entry: 7
|
Entry: 7
|
||||||
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 6
|
Entry: 3
|
||||||
Data:
|
Data: 1
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 8
|
Entry: 8
|
||||||
Data:
|
Data:
|
||||||
@ -206,7 +206,241 @@ MonoBehaviour:
|
|||||||
Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
Data: 12|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 12
|
Entry: 12
|
||||||
Data: 0
|
Data: 1
|
||||||
|
- Name:
|
||||||
|
Entry: 7
|
||||||
|
Data: 13|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 13
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 7
|
||||||
|
Data:
|
||||||
|
- Name: $k
|
||||||
|
Entry: 1
|
||||||
|
Data: PlayerData_Host
|
||||||
|
- Name: $v
|
||||||
|
Entry: 7
|
||||||
|
Data: 14|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
|
- Name: <Name>k__BackingField
|
||||||
|
Entry: 1
|
||||||
|
Data: PlayerData_Host
|
||||||
|
- Name: <UserType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 11
|
||||||
|
- Name: <SystemType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 11
|
||||||
|
- Name: <SyncMode>k__BackingField
|
||||||
|
Entry: 7
|
||||||
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 3
|
||||||
|
Data: 1
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name: <IsSerialized>k__BackingField
|
||||||
|
Entry: 5
|
||||||
|
Data: false
|
||||||
|
- Name: _fieldAttributes
|
||||||
|
Entry: 7
|
||||||
|
Data: 15|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 12
|
||||||
|
Data: 1
|
||||||
|
- Name:
|
||||||
|
Entry: 7
|
||||||
|
Data: 16|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 13
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 7
|
||||||
|
Data:
|
||||||
|
- Name: $k
|
||||||
|
Entry: 1
|
||||||
|
Data: PlayerData_Camera
|
||||||
|
- Name: $v
|
||||||
|
Entry: 7
|
||||||
|
Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
|
- Name: <Name>k__BackingField
|
||||||
|
Entry: 1
|
||||||
|
Data: PlayerData_Camera
|
||||||
|
- Name: <UserType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 11
|
||||||
|
- Name: <SystemType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 11
|
||||||
|
- Name: <SyncMode>k__BackingField
|
||||||
|
Entry: 7
|
||||||
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 3
|
||||||
|
Data: 1
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name: <IsSerialized>k__BackingField
|
||||||
|
Entry: 5
|
||||||
|
Data: false
|
||||||
|
- Name: _fieldAttributes
|
||||||
|
Entry: 7
|
||||||
|
Data: 18|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 12
|
||||||
|
Data: 1
|
||||||
|
- Name:
|
||||||
|
Entry: 7
|
||||||
|
Data: 19|UdonSharp.UdonSyncedAttribute, UdonSharp.Runtime
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 13
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 7
|
||||||
|
Data:
|
||||||
|
- Name: $k
|
||||||
|
Entry: 1
|
||||||
|
Data: _ListContainer
|
||||||
|
- Name: $v
|
||||||
|
Entry: 7
|
||||||
|
Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
|
- Name: <Name>k__BackingField
|
||||||
|
Entry: 1
|
||||||
|
Data: _ListContainer
|
||||||
|
- Name: <UserType>k__BackingField
|
||||||
|
Entry: 7
|
||||||
|
Data: 21|System.RuntimeType, mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 1
|
||||||
|
Data: UnityEngine.RectTransform, UnityEngine.CoreModule
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name: <SystemType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 21
|
||||||
|
- Name: <SyncMode>k__BackingField
|
||||||
|
Entry: 7
|
||||||
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 6
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name: <IsSerialized>k__BackingField
|
||||||
|
Entry: 5
|
||||||
|
Data: true
|
||||||
|
- Name: _fieldAttributes
|
||||||
|
Entry: 7
|
||||||
|
Data: 22|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 12
|
||||||
|
Data: 1
|
||||||
|
- Name:
|
||||||
|
Entry: 7
|
||||||
|
Data: 23|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 13
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 7
|
||||||
|
Data:
|
||||||
|
- Name: $k
|
||||||
|
Entry: 1
|
||||||
|
Data: _PlayerItemTemplate
|
||||||
|
- Name: $v
|
||||||
|
Entry: 7
|
||||||
|
Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor
|
||||||
|
- Name: <Name>k__BackingField
|
||||||
|
Entry: 1
|
||||||
|
Data: _PlayerItemTemplate
|
||||||
|
- Name: <UserType>k__BackingField
|
||||||
|
Entry: 7
|
||||||
|
Data: 25|System.RuntimeType, mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 1
|
||||||
|
Data: UnityEngine.GameObject, UnityEngine.CoreModule
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name: <SystemType>k__BackingField
|
||||||
|
Entry: 9
|
||||||
|
Data: 25
|
||||||
|
- Name: <SyncMode>k__BackingField
|
||||||
|
Entry: 7
|
||||||
|
Data: System.Nullable`1[[UdonSharp.UdonSyncMode, UdonSharp.Runtime]], mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 6
|
||||||
|
Data:
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
|
- Name: <IsSerialized>k__BackingField
|
||||||
|
Entry: 5
|
||||||
|
Data: true
|
||||||
|
- Name: _fieldAttributes
|
||||||
|
Entry: 7
|
||||||
|
Data: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib
|
||||||
|
- Name:
|
||||||
|
Entry: 12
|
||||||
|
Data: 1
|
||||||
|
- Name:
|
||||||
|
Entry: 7
|
||||||
|
Data: 27|UnityEngine.SerializeField, UnityEngine.CoreModule
|
||||||
|
- Name:
|
||||||
|
Entry: 8
|
||||||
|
Data:
|
||||||
- Name:
|
- Name:
|
||||||
Entry: 13
|
Entry: 13
|
||||||
Data:
|
Data:
|
||||||
|
|||||||
@ -3,57 +3,133 @@ using UdonSharp;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using VRC.SDK3.Data;
|
using VRC.SDK3.Data;
|
||||||
using VRC.SDKBase;
|
using VRC.SDKBase;
|
||||||
|
using VRC.Udon.Common;
|
||||||
|
|
||||||
|
|
||||||
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
|
[UdonBehaviourSyncMode(BehaviourSyncMode.Manual)]
|
||||||
public class PermissionsPanel : UdonSharpBehaviour
|
public class PermissionsPanel : UdonSharpBehaviour
|
||||||
{
|
{
|
||||||
[SerializeField] private RectTransform _ListContainer;
|
[UdonSynced] private string[] PlayerData_Name = new string[MAX_PLAYERS_IN_LIST];
|
||||||
|
[UdonSynced] private int[] PlayerData_ID = new int[MAX_PLAYERS_IN_LIST];
|
||||||
|
[UdonSynced] private bool[] PlayerData_Admin = new bool[MAX_PLAYERS_IN_LIST];
|
||||||
|
[UdonSynced] private bool[] PlayerData_Host = new bool[MAX_PLAYERS_IN_LIST];
|
||||||
|
[UdonSynced] private bool[] PlayerData_Camera = new bool[MAX_PLAYERS_IN_LIST];
|
||||||
|
|
||||||
|
[SerializeField] private RectTransform _ListContainer;
|
||||||
[SerializeField] private GameObject _PlayerItemTemplate;
|
[SerializeField] private GameObject _PlayerItemTemplate;
|
||||||
|
|
||||||
private DataDictionary PlayerData = new DataDictionary();
|
private const int MAX_PLAYERS_IN_LIST = 85;
|
||||||
|
|
||||||
|
|
||||||
public override void OnPlayerJoined(VRCPlayerApi Player)
|
public override void OnPlayerJoined(VRCPlayerApi Player)
|
||||||
{
|
{
|
||||||
GameObject NewListItem = Instantiate<GameObject>(_PlayerItemTemplate, _ListContainer, false);
|
for (int i = 0; i < MAX_PLAYERS_IN_LIST; i++)
|
||||||
NewListItem.SetActive(true);
|
|
||||||
PermissionsPanelPlayerEntry PlayerListItem = NewListItem.GetComponent<PermissionsPanelPlayerEntry>();
|
|
||||||
PlayerListItem.PlayerNameUI.text = Player.displayName;
|
|
||||||
|
|
||||||
PlayerData[Player.displayName] = new DataDictionary();
|
|
||||||
PlayerData[Player.displayName].DataDictionary["Admin"] = Player.isInstanceOwner;
|
|
||||||
PlayerData[Player.displayName].DataDictionary["Host"] = Player.isInstanceOwner;
|
|
||||||
PlayerData[Player.displayName].DataDictionary["Camera"] = Player.isInstanceOwner;
|
|
||||||
|
|
||||||
if (Networking.LocalPlayer.isInstanceOwner)
|
|
||||||
{
|
{
|
||||||
PlayerListItem.AdminToggle.interactable = true;
|
if (PlayerData_Name[i] == null)
|
||||||
PlayerListItem.HostToggle.interactable = true;
|
{
|
||||||
PlayerListItem.CameraToggle.interactable = true;
|
PlayerData_Name[i] = Player.displayName;
|
||||||
|
PlayerData_ID[i] = Player.playerId;
|
||||||
|
|
||||||
PlayerListItem.AdminToggle.SetIsOnWithoutNotify(true);
|
PlayerData_Admin[i] = (Player.isInstanceOwner || Player.isMaster);
|
||||||
PlayerListItem.HostToggle.SetIsOnWithoutNotify(true);
|
PlayerData_Host[i] = (Player.isInstanceOwner || Player.isMaster);
|
||||||
PlayerListItem.CameraToggle.SetIsOnWithoutNotify(true);
|
PlayerData_Camera[i] = (Player.isInstanceOwner || Player.isMaster);
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RequestSerialization();
|
||||||
|
|
||||||
base.OnPlayerJoined(Player);
|
base.OnPlayerJoined(Player);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnPlayerLeft(VRCPlayerApi player)
|
public override void OnPlayerLeft(VRCPlayerApi Player)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < MAX_PLAYERS_IN_LIST; i++)
|
||||||
|
{
|
||||||
|
if (PlayerData_Name[i] == Player.displayName)
|
||||||
|
{
|
||||||
|
PlayerData_Name[i] = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
string[] NewPlayerData_Name = new string[MAX_PLAYERS_IN_LIST];
|
||||||
|
int[] NewPlayerData_ID = new int[MAX_PLAYERS_IN_LIST];
|
||||||
|
bool[] NewPlayerData_Admin = new bool[MAX_PLAYERS_IN_LIST];
|
||||||
|
bool[] NewPlayerData_Host = new bool[MAX_PLAYERS_IN_LIST];
|
||||||
|
bool[] NewPlayerData_Camera = new bool[MAX_PLAYERS_IN_LIST];
|
||||||
|
|
||||||
|
for (int i = 0; i < MAX_PLAYERS_IN_LIST; i++)
|
||||||
|
{
|
||||||
|
for (int j = i; j < MAX_PLAYERS_IN_LIST; j++)
|
||||||
|
{
|
||||||
|
if (PlayerData_Name[j] != null)
|
||||||
|
{
|
||||||
|
NewPlayerData_Name[i] = PlayerData_Name[j];
|
||||||
|
NewPlayerData_ID[i] = PlayerData_ID[j];
|
||||||
|
NewPlayerData_Admin[i] = PlayerData_Admin[j];
|
||||||
|
NewPlayerData_Host[i] = PlayerData_Host[j];
|
||||||
|
NewPlayerData_Camera[i] = PlayerData_Camera[j];
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PlayerData_Name = NewPlayerData_Name;
|
||||||
|
PlayerData_ID = NewPlayerData_ID;
|
||||||
|
PlayerData_Admin = NewPlayerData_Admin;
|
||||||
|
PlayerData_Host = NewPlayerData_Host;
|
||||||
|
PlayerData_Camera = NewPlayerData_Camera;
|
||||||
|
|
||||||
|
RequestSerialization();
|
||||||
|
|
||||||
|
base.OnPlayerLeft(Player);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnDeserialization(DeserializationResult Result)
|
||||||
|
{
|
||||||
|
base.OnDeserialization(Result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void PermissionsChanged()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < _ListContainer.childCount; i++)
|
for (int i = 0; i < _ListContainer.childCount; i++)
|
||||||
{
|
{
|
||||||
GameObject Entry = _ListContainer.GetChild(i).gameObject;
|
GameObject Entry = _ListContainer.GetChild(i).gameObject;
|
||||||
PermissionsPanelPlayerEntry PlayerEntry = Entry.GetComponent<PermissionsPanelPlayerEntry>();
|
PermissionsPanelPlayerEntry PlayerEntry = Entry.GetComponent<PermissionsPanelPlayerEntry>();
|
||||||
if (PlayerEntry != null && PlayerEntry.PlayerNameUI.text == player.displayName)
|
|
||||||
{
|
PlayerData_Admin[i] = PlayerEntry.AdminToggle.isOn;
|
||||||
Destroy(Entry);
|
PlayerData_Host[i] = PlayerEntry.HostToggle.isOn;
|
||||||
break;
|
PlayerData_Camera[i] = PlayerEntry.CameraToggle.isOn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
base.OnPlayerLeft(player);
|
|
||||||
|
private void RebuildPlayerList()
|
||||||
|
{
|
||||||
|
int CurrentListCount = _ListContainer.childCount;
|
||||||
|
for (int i = 0; i < CurrentListCount; i++)
|
||||||
|
{
|
||||||
|
Destroy(_ListContainer.GetChild(CurrentListCount - i - 1).gameObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < VRCPlayerApi.GetPlayerCount(); i++)
|
||||||
|
{
|
||||||
|
GameObject NewListItem = Instantiate<GameObject>(_PlayerItemTemplate, _ListContainer, false);
|
||||||
|
NewListItem.SetActive(true);
|
||||||
|
PermissionsPanelPlayerEntry PlayerListItem = NewListItem.GetComponent<PermissionsPanelPlayerEntry>();
|
||||||
|
PlayerListItem.PlayerNameUI.text = PlayerData_Name[i];
|
||||||
|
|
||||||
|
PlayerListItem.AdminToggle.SetIsOnWithoutNotify(PlayerData_Admin[i]);
|
||||||
|
PlayerListItem.HostToggle.SetIsOnWithoutNotify(PlayerData_Host[i]);
|
||||||
|
PlayerListItem.CameraToggle.SetIsOnWithoutNotify(PlayerData_Camera[i]);
|
||||||
|
|
||||||
|
PlayerListItem.AdminToggle.interactable = false;
|
||||||
|
PlayerListItem.HostToggle.interactable = false;
|
||||||
|
PlayerListItem.CameraToggle.interactable = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user