private void AdvanceToNextCompanionCard() { if (currentCompanionCard != null) { Destroy(currentCompanionCard.gameObject); } if (companionCards.Count > 0) { currentCompanionCard = companionCards.Pop(); } else { currentCompanionCard = null; } RefreshCompanionsRemainingLabel(); }
public void OnTapFindMoreCompanions() { if (Player.instance.energy > 0) { --Player.instance.energy; var oldCompanions = Player.instance.companionsToMeetAgain.ToList(); Gender companionGender = Player.instance.gender == Gender.Male ? Gender.Female : Gender.Male; for (int companionCounter = 0; companionCounter < numCompanionsGeneratedPerRoll; ++companionCounter) { Companion companion; if (oldCompanions.Count > 0) { companion = oldCompanions[0]; oldCompanions.RemoveAt(0); } else { companion = CompanionGenerator.instance.CreateCompanion(companionGender); } var companionCard = Instantiate(companionCardPrefab); companionCard.companion = companion; companionCard.transform.SetParent(companionCardAnchor, false); companionCards.Push(companionCard); } if (currentCompanionCard == null) { currentCompanionCard = companionCards.Pop(); } RefreshCompanionsRemainingLabel(); } }