using System.Collections; using System.Collections.Generic; using UnityEngine; using Networking.Client; using UnityEngine.UI; public class animalSelection : MonoBehaviour { public ConnectedClients Clients; public List Animals; //private void OnEnable() //{ // Clients.OnClientsChange += UpdateAnimals; //} // //private void OnDisable() //{ // Clients.OnClientsChange -= UpdateAnimals; //} public void Update() { if (Clients.AllClients.Count > 0) { for (int i = 0; i < Clients.AllClients.Count; i++) { for (int j = 0; j < Animals.Count; j++) { if (Clients.AllClients[i].characterAnimal == Animals[j].name) { Animals[j].GetComponent().color = Color.black; Animals[j].enabled = false; } } } } } }