public void RecycleHand() { GameObject cGO; Card c; int cardCount = hand.CardCount(); Debug.Log("Recycling hand"); for (int i = 0; i < cardCount; i++) { c = hand.RemoveCardFromHand(); if (c != null) { cGO = c.CardPrefabInst; if (cGO != null) { Destroy(cGO); } c.CardPrefabInst = null; } deckSC.ReplaceCardOnDeck(c); } Debug.Log("After recycle, card count: " + hand.CardCount()); }