I have the following code in one of my components. The outer foreach loop works just fine (the “zone_transform” debug message prints just as expected); however, the inner foreach loop doesn’t do anything. Ever…
What is wrong with my code? Any help would be greatly appreciated.
private IEnumerator DealOutTheCardsCoroutine() {
Debug.Log("Handing cards out to each player stack.");
int which_card=0;;
foreach (Transform zone_transform in _targetPoints) {
Debug.LogFormat("Zone Transform: {0}", zone_transform);
foreach(Transform child_transform in zone_transform) {
Debug.Log("Child Transform: {0}", child_transform);
CardFlipper card = _dealtCards[which_card++];
StartCoroutine(MoveCardToPointCoroutine(card, child_transform.position));
yield return new WaitForSeconds(_dealCardDelay);
child_transform.SetParent(_canvasTransform, false);
child_transform.gameObject.SetActive(false);
}
}
Debug.Log("Done dealing out all of the cards.");
yield break;
}