unity cant get length of list code example
Example 1: unity list length
public List<GameObject> gameObjects = new List<GameObject>();
void Start()
{
int listLength = gameObjects.Count;
}
Example 2: unity get list length
//Get list length / count
//Example
public List<GameObject> gameObjects = new List<GameObject>();
void Update()
{
int listLength = gameObject.Count;
if(listLength >= 0)
Debug.Log("Do something");
else
Debug.Log("Do something else");
}