valentincognito
9/14/2017 - 7:42 AM

Get First Active Object Index

Get the index of the first active child

private int GetFirstActiveindex(GameObject _parentObject)
{
  for (int i = 0; i < _parentObject.transform.childCount; i++)
  {
      if (_parentObject.transform.GetChild(i).gameObject.activeSelf == true) return i;
  }
  return 0;
}