Answers for "how to get the length list in c# unity"

C#
5

unity list length

public List<GameObject> gameObjects = new List<GameObject>();
void Start()
{
	int listLength = gameObjects.Count;
}
Posted by: Guest on March-23-2020
3

how to get the length list in c# unity

public List<Transform> items = new List<Transform>();

void Start()
{
    print(items.Count);
  
    items.Add(new Transform());
  
    print(items.Count);
}

//output\\

/// 0 

/// 1
Posted by: Guest on April-28-2020
1

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");
}
Posted by: Guest on December-15-2019

Code answers related to "how to get the length list in c# unity"

C# Answers by Framework

Browse Popular Code Answers by Language