Esempio n. 1
0
        public void world_SpawnPlayerList(S2GC_PlayerList spawnList)
        {
            foreach (S2GC_PlayerList.PlayerSpawnData p in spawnList.Data)
            {
                if (p.PlayerID != Player_Self.PlayerID)
                {
                    PlayerData_Other newPlayer = GameObject.Instantiate(playerOtherPrefab).GetComponent <PlayerData_Other>();
                    newPlayer.PlayerID        = p.PlayerID;
                    newPlayer.CharacterName   = p.CharacterName;
                    newPlayer.gameObject.name = p.CharacterName;
                    newPlayer.gameObject.transform.position = p.Position.V3;
                    newPlayer.gameObject.transform.rotation = Quaternion.Euler(p.Rotation.V3);
                    newPlayer.Level              = p.Level;
                    newPlayer.Health             = p.HP;
                    newPlayer.maxHealth          = p.MaxHP;
                    newPlayer.Energy             = p.Energy;
                    newPlayer.maxEnergy          = p.MaxEnergy;
                    newPlayer.CharacterGender    = p.CharacterGender;
                    newPlayer.CharacterEyeShape  = p.CharacterEyeShape;
                    newPlayer.CharacterEyeType   = p.CharacterEyeType;
                    newPlayer.CharacterEyeColor  = p.CharacterEyeColor.V4;
                    newPlayer.CharacterFrontHair = p.CharacterFrontHair;
                    newPlayer.CharacterBackHair  = p.CharacterBackHair;
                    newPlayer.CharacterHairColor = p.CharacterHairColor.V4;

                    newPlayer.Init(e);

                    e.getUI().ui_world_CreatePlayerNameplate(newPlayer);

                    e.getUI().ui_chat_CreateMessage(ChatMSGType.System, "", p.CharacterName + " has joined.");

                    PlayerList.Add(newPlayer);
                }
            }
        }
Esempio n. 2
0
        public void net_onFullClientList(NetworkMessage netmsg)
        {
            S2GC_PlayerList playerList = netmsg.ReadMessage <S2GC_PlayerList>();

            e.getWorld().world_SpawnPlayerList(playerList);
        }