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.

29 lines
851 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Networking.Server;
  5. using UnityEngine.UI;
  6. public class animalSelection : MonoBehaviour
  7. {
  8. public ClientList Clients;
  9. public List<Toggle> Animals;
  10. void Update()
  11. //change function to react on push from the server
  12. {
  13. if (Clients.ConnectedClients.Count > 0)
  14. {
  15. for (int i = 0; i < Clients.ConnectedClients.Count; i++)
  16. {
  17. for (int j = 0; j < Animals.Count; j++)
  18. {
  19. if (Clients.ConnectedClients[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. }