Ejemplo n.º 1
0
    public void SetCuckatiel(int id, SeedPlayer player)
    {
        this.player  = player;
        cuckatieldId = id;

        UpdateColor();
    }
Ejemplo n.º 2
0
 public void AddPlayer(SeedPlayer player)
 {
     players.Add(player);
     player.carController = carController;
     player.SetColor(player.carController.currentColor);
     player.carId = id;
 }
Ejemplo n.º 3
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);
    }
Ejemplo n.º 4
0
    public void SetCuckatiel(SeedPlayer player)
    {
        this.player      = player;
        cuckatieldId     = player.cuckatID;
        player.cuckatiel = this;

        UpdateColor();
    }
Ejemplo n.º 5
0
    public void RemovePlayer(SeedPlayer player)
    {
        if (playerImages.ContainsKey(player))
        {
            GameObject toDestroy = playerImages[player];

            Destroy(toDestroy);

            playerImages.Remove(player);
        }
    }
Ejemplo n.º 6
0
    public void AddPlayer(SeedPlayer player)
    {
        GameObject newImage = GameObject.Instantiate(prefabImage);

        newImage.transform.SetParent(presentationParent);
        Image imageRef = newImage.GetComponentInChildren <Image>();

        if (imageRef == null)
        {
            imageRef = newImage.GetComponentInChildren <Image>();
        }
        imageRef.sprite = sprites[player.cuckatID];
        newImage.SetActive(true);

        playerImages.Add(player, newImage);
    }
Ejemplo n.º 7
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);
            }
        }
Ejemplo n.º 8
0
    public void RemovePlayer(SeedPlayer player)
    {
        players.Remove(player);
        if (!isGamePlaying)
        {
            if (players.Count == 1)
            {
                players[0].DisplayMessage("You can't play alone!");
            }
            else if (player.actions[1].action == SeedPlayer.PlayerActions.Start)
            {
                if (players.Count > 1)
                {
                    players[0].SetActions(SeedPlayer.PlayerActions.Scream, SeedPlayer.PlayerActions.Start);
                }
            }
        }
        else
        {
            int carId = player.carId;
            if (carId != -1)
            {
                cars[carId].RemovePlayer(player);
                if (cars[carId].players.Count < 2)
                {
                    cars[carId].carController.seedCounter = 0;
                }
                else
                {
                    ScrambleCarPlaces(carId);
                }
            }
        }

        uIManager.RemovePlayer(player);
    }
Ejemplo n.º 9
0
 public void AddCuckatiel(Cuckatiel c, SeedPlayer sp)
 {
     cuckatiels.Add(sp, c);
 }