Exemplo n.º 1
0
    public void AttachFlagToGameObject(GameObject obj)
    {
        PlayerController101 pc = obj.GetComponent <PlayerController101>();

        if (pc)
        {
            this.transform.parent = obj.transform;
            pc.CmdPickUpFlag();
        }
    }
Exemplo n.º 2
0
    public override void OnLobbyServerSceneLoadedForPlayer(NetworkManager manager, GameObject lobbyPlayer, GameObject gamePlayer)
    {
        LobbyPlayer         lobby  = lobbyPlayer.GetComponent <LobbyPlayer>();
        PlayerController101 player = gamePlayer.GetComponent <PlayerController101>();

        if (lobby.playerName.Length > 0)
        {
            player.playerName = lobby.playerName;
        }
        else
        {
            player.playerName = "Player";
        }

        player.color = lobby.playerColor;
        //  spaceship.score = 0;
        //  spaceship.lifeCount = 3;
    }