Example #1
0
        private void RemovePlayerFromList(Player otherPlayer)
        {
            PreGamePlayerListing playerListing = GetPlayerListing(otherPlayer);

            if (playerListing != null)
            {
                playerListing.UnSetPlayer();
            }
        }
Example #2
0
        private void AddPlayerToList(Player newPlayer)
        {
            PreGamePlayerListing playerListing = FindBlankListing();

            if (playerListing != null)
            {
                playerListing.InitializeListing(newPlayer.ActorNumber, newPlayer.NickName);
                object readyObject;
                if (newPlayer.CustomProperties.TryGetValue("ready", out readyObject))
                {
                    playerListing.SetReady((bool)readyObject);
                }
            }
        }
Example #3
0
        // override public void OnEnable()
        // {
        //     base.OnEnable();
        //     InitializePlayerList();
        // }

        override public void OnPlayerPropertiesUpdate(Player target, ExitGames.Client.Photon.Hashtable changedProps)
        {
            PreGamePlayerListing playerListing = GetPlayerListing(target);
            object readyObject;

            if (changedProps.TryGetValue("ready", out readyObject))
            {
                playerListing.SetReady((bool)readyObject);
            }
            else
            {
                playerListing.SetReady(false);
            }
        }