public void End() { for (int i = 0; i < stages; i++) { List <AdventureCard> tmp = new List <AdventureCard>(stagesTransforms[i].GetComponentsInChildren <AdventureCard>()); stageModels[i].addList(tmp); } if (validateStages()) { Debug.Log("[Sponsor.cs:end] Validation passed"); List <AdventureCard> allCards = new List <AdventureCard>(); SetupModel sponsorship = new SetupModel(); for (int i = 0; i < stages; i++) { allCards.AddRange(stageModels[i].cardsPlayed); int numcards = stagesTransforms[i].childCount; for (int j = 0; j < numcards; j++) { stagesTransforms[i].GetChild(0).SetParent(questStagesObjects[i].transform); } stagesObjects[i].SetActive(false); sponsorship.Add(stageModels[i]); } Debug.Log("[Sponsor.cs:end] Removing sponsor's played cards"); game.players[game.currPlayer].GetComponent <PlayerController>().removeCards(allCards); game.storeSponsors(sponsorship); questCard = null; stages = 0; Debug.Log("[Sponsor.cs:end] Sponsorship complete"); game.view.EndSponsor(); game.PromptQuest(); game.setNextPlayer(); } }