I have instantiated a Scroll Rect Prefab inside a canvas and now I need to get all the children of that instantiated prefab and also the text components in each one of them.
I failed to get them with the code below.
UIManager.uiManager.NewCanvasMenuCityPrefabs[Number]
is the reference to the instantiated canvas element prefab.
Transform[] Parent = UIManager.uiManager.NewCanvasMenuCityPrefabs[Number].transform.GetComponentsInChildren< Transform >();
foreach (Transform Child in Parent)
{
print(Child);
}
But still I couldn't get any of the children of the element.