public override void Enable() { base.Enable(); menu.transform.SetParent(transform, false); fractionMenu.transform.SetParent(transform, false); fractionMenu.SetActiveBattons(fractions.Fractions).SetListener(SelectFraction); fractionMenu.SetSelecedButton(fractions.CurrentFraction); }
public void Construct(IDeckFactory deckFactory, IFractionsData fractions, IUserData userDecks, FractionsMenu fractionMenu) { (this.deckFactory, this.fractions, this.userDecks, this.fractionMenu) = (deckFactory, fractions, userDecks, fractionMenu); startBattelButton.onClick.AddListener(OnStartBattel); if (this.userDecks.CurrentDeck != null) { fractions.CurrentFraction = fractions.GetFraction(this.userDecks.CurrentDeck.Fraction); } if (fractions.CurrentFraction.Name == "neutral") { fractions.CurrentFraction = fractions.Fractions[0]; } fractionMenu.transform.SetParent(transform, false); fractionMenu.SetActiveBattons(fractions.Fractions.Where(x => x.Name != "neutral").ToList()).SetListener(SelectFraction); fractionMenu.SetSelecedButton(fractions.CurrentFraction); }