public class move : MonoBehaviour
{
public GameObject lefthand;
public Transform[] lchilds;
public int lcount;
private void Update()
{
lchilds = new Transform[lefthand.transform.childCount];
lcount = lefthand.transform.childCount;
for (int i = 0; i < lefthand.transform.childCount; i++)
{
lchilds *= lefthand.transform.GetChild(i);*
}
Transform llastchild = lchilds[lchilds.Length-1];
}
}
I define a array and objects are added to this array throughout the game. The added objects are of 3 types. 3 kinds of objects named A, B and C are added. I want to find out how many “A”, how many “B”, how many “C” there are in the series. Is there a way to do this?