Exemplo n.º 1
0
 public void AddPlayer(SeedPlayer player)
 {
     players.Add(player);
     player.carController = carController;
     player.SetColor(player.carController.currentColor);
     player.carId = id;
 }
Exemplo n.º 2
0
    public void AddPlayer(SeedPlayer player)
    {
        players.Add(player);
        player.SetColor(Color.grey);
        if (!isGamePlaying)
        {
            if (players.Count == 1)
            {
                player.DisplayMessage("You can't play alone!");
                // player.SetActions(SeedPlayer.PlayerActions.Scream ,SeedPlayer.PlayerActions.Start);
            }
            else if (players.Count == 2)
            {
                players[0].SetActions(SeedPlayer.PlayerActions.Scream, SeedPlayer.PlayerActions.Start);
                player.SetActions(SeedPlayer.PlayerActions.Scream);
            }
            else
            {
                player.SetActions(SeedPlayer.PlayerActions.Scream);
            }
        }
        else
        {
            player.DisplayMessage("Wait for match to end!");
        }

        uIManager.AddPlayer(player);
    }
Exemplo n.º 3
0
        public void RemovePlayer(SeedPlayer player)
        {
            players.Remove(player);
            player.carController = null;
            player.carId         = -1;

            if (player.gameObject != null)
            {
                player.SetColor(Color.grey);
                player.DisplayMessage("Your " + colorName + " car was arrested!");
            }
            if (cuckatiels.ContainsKey(player))
            {
                Destroy(cuckatiels[player]);
                cuckatiels.Remove(player);
            }
        }