Hey! I am trying to use an array like I would use a list; in this case I am trying to find a specific outlier and destroy it. Would be much appreciated if someone could help me out!
if(LoadNumber == 0)
{
if(inLobby == true)
{
MainMenuGUI.Instance.ToMenu("Lobby");
GameObject[] NetworkManagers;
NetworkManagers = GameObject.FindGameObjectsWithTag("NetworkManager");
foreach(NetworkManagers nm in NetworkManagers)
{
if(nm.transform.GetComponent<NetworkManager>().PlayerList.count <= 0)
{
Destroy(nm);
}
}
}
}