예제 #1
0
        public override void OnPlayerJoined(VRCPlayerApi player)
        {
            var id = VRCPlayerApi.GetPlayerId(player);

            UpdateMaster(id);

            UpdateDisplay();
        }
예제 #2
0
        private bool TestGettingPlayerInfo()
        {
            Debug.Log("TestGettingPlayerInfo");

            Debug.Log("GetPlayerById(-1)");
            VRCPlayerApi player = VRCPlayerApi.GetPlayerById(-1);

            if (player != null)
            {
                Debug.LogError("Player -1 is not null?");
                return(false);
            }

            Debug.Log("GetPlayerById(1)");
            player = VRCPlayerApi.GetPlayerById(1);
            if (player == null)
            {
                Debug.LogError("Player 1 is null");
                return(false);
            }

            Debug.Log("GetPlayerId(_localPlayer)");
            int id = VRCPlayerApi.GetPlayerId(_localPlayer);

            if (id != _localPlayer.playerId)
            {
                Debug.LogError("GetPlayerId returned the wrong value for the local player");
                return(false);
            }

            Debug.Log("GetPlayerId(null)");
            id = VRCPlayerApi.GetPlayerId(null);
            if (id != -1)
            {
                Debug.LogError("GetPlayerId returned the wrong value for the local player");
                return(false);
            }

            return(true);
        }