You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
826 B

  1. using System.Collections.Generic;
  2. using UnityEngine;
  3. using Networking.Client;
  4. using UnityEngine.UI;
  5. public class animalSelection : MonoBehaviour
  6. {
  7. public ConnectedClients Clients;
  8. public List<Toggle> Animals;
  9. public int count;
  10. public void Update()
  11. {
  12. count = Clients.AllClients.Count;
  13. if (Clients.AllClients.Count > 0)
  14. {
  15. for (int i = 0; i < Clients.AllClients.Count; i++)
  16. {
  17. for (int j = 0; j < Animals.Count; j++)
  18. {
  19. if (Clients.AllClients[i].characterAnimal == Animals[j].name)
  20. {
  21. Animals[j].GetComponent<Image>().color = Color.black;
  22. Animals[j].enabled = false;
  23. }
  24. }
  25. }
  26. }
  27. }
  28. }