Beispiel #1
0
        private void OnConnect(Networking.NetworkPlayer obj)
        {
            if (!obj.IsSelf)
            {
                return;
            }

            InitSelf(obj.Player);
        }
Beispiel #2
0
        private Player CreatePlayerObject(Networking.NetworkPlayer netPlayer)
        {
            var player = GameObject.Instantiate <Player>(PlayerPrefab);

            player.Initialize(netPlayer, LocalInputGrabber, ConnectionManager.connectionMode == ConnectionMode.SERVER);

            Spawner.Spawn(player);

            return(player);
        }
Beispiel #3
0
        private void OnPlayerDisconnect(Networking.NetworkPlayer player)
        {
            var go = NetworkToGameMap[player];

            NetworkToGameMap.Remove(player);

            GameObject.Destroy(go);

            Debug.Log("OnPlayerDisconnect Player #" + player.ID + "(" + player.Name + ")");
        }
Beispiel #4
0
        private void OnPlayerConnect(Networking.NetworkPlayer netPlayer)
        {
            //var go = GameObject.CreatePrimitive(PrimitiveType.Sphere);

            //go.name = "Player_" + player.Name;

            Player player = CreatePlayerObject(netPlayer);

            NetworkToGameMap.Add(netPlayer, player);

            Debug.Log("OnPlayerConnect Player #" + netPlayer.ID + "(" + netPlayer.Name + ")");
        }