public void OnEvent(Object messageData, CardsGameClass cardsGameClass) { switch (messageData.ToString()) { case "openPopup": if (!_flagPopup) { _cardGame = cardsGameClass; _classPopup.SetActive(true); ActionsWithCard cardDis = _classView.GetComponent <ActionsWithCard>(); cardDis.CardSetup(_cardGame); _classView.gameObject.GetComponent <Animator>().SetBool("view", true); _flagPopup = true; } break; /*case "selectClass": * if(_flagPopup) * { * _publisher.Publish(this,"selectClass", cardsClass); * _classPopup.SetActive(false); * _flagPopup = false; * } * break;*/ } }
public void Publish(object sender, object messagedata, CardsGameClass cardsGameClass) { foreach (var _subscriber in _subscribers) { _subscriber.OnEvent(messagedata, cardsGameClass); } }
public void OnEvent(object messageData, CardsGameClass cardsGameClass) { switch (messageData.ToString()) { case "saveClass": SetClass(cardsGameClass); break; } }
public void CardSetup <T>(T thisCard) { _cardGame = thisCard as CardsGameClass; if (_cardGame != null) { cardImage.sprite = _cardGame.art; cardFace.sprite = _cardGame.face; } }
public void SetClass(CardsGameClass cardGame) { sv.nameClass = cardGame.cardName; sv.id = cardGame.id; }
public void SaveClass(CardsGameClass cardGame) //сохраняем игровой класс { _sv.NameClass = cardGame.cardName.ToString(); }