Exemple #1
0
    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;*/
        }
    }
Exemple #2
0
 public void Publish(object sender, object messagedata, CardsGameClass cardsGameClass)
 {
     foreach (var _subscriber in _subscribers)
     {
         _subscriber.OnEvent(messagedata, cardsGameClass);
     }
 }
Exemple #3
0
 public void OnEvent(object messageData, CardsGameClass cardsGameClass)
 {
     switch (messageData.ToString())
     {
     case "saveClass":
         SetClass(cardsGameClass);
         break;
     }
 }
Exemple #4
0
 public void CardSetup <T>(T thisCard)
 {
     _cardGame = thisCard as CardsGameClass;
     if (_cardGame != null)
     {
         cardImage.sprite = _cardGame.art;
         cardFace.sprite  = _cardGame.face;
     }
 }
Exemple #5
0
 public void SetClass(CardsGameClass cardGame)
 {
     sv.nameClass = cardGame.cardName;
     sv.id        = cardGame.id;
 }
Exemple #6
0
 public void SaveClass(CardsGameClass cardGame)   //сохраняем игровой класс
 {
     _sv.NameClass = cardGame.cardName.ToString();
 }