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.
 
 
 
 
 
 

42 lines
1.0 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Networking.Client;
using UnityEngine.UI;
public class animalSelection : MonoBehaviour
{
public ConnectedClients Clients;
public List<Toggle> Animals;
public int count;
//private void OnEnable()
//{
// Clients.OnClientsChange += UpdateAnimals;
//}
//
//private void OnDisable()
//{
// Clients.OnClientsChange -= UpdateAnimals;
//}
public void Update()
{
count = Clients.AllClients.Count;
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<Image>().color = Color.black;
Animals[j].enabled = false;
}
}
}
}
}
}