Answers for "get index of item unity"

C#
1

get index of item unity

int getIndex(GameObject[] list, GameObject item)
{
	for(int i=0;i<list.Length;i++)
    {
    	if(list[i] == item) return i;
    }
    return -1;
}
Posted by: Guest on July-12-2021
-1

get index of item unity

int getIndex(GameObject[] list, GameObject[] item)
{
	for(int i=0;i<list.Length;i++)
    {
    	if(list[i] == item) return i;
    }
    return -1;
}
Posted by: Guest on July-12-2021

C# Answers by Framework

Browse Popular Code Answers by Language