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
851 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Networking.Server;
using UnityEngine.UI;
public class animalSelection : MonoBehaviour
{
public ClientList Clients;
public List<Toggle> Animals;
void Update()
//change function to react on push from the server
{
if (Clients.ConnectedClients.Count > 0)
{
for (int i = 0; i < Clients.ConnectedClients.Count; i++)
{
for (int j = 0; j < Animals.Count; j++)
{
if (Clients.ConnectedClients[i].characterAnimal == Animals[j].name)
{
Animals[j].GetComponent<Image>().color = Color.black;
Animals[j].enabled = false;
}
}
}
}
}
}