示例#1
0
        private CharacterCard RemvoeActiveCard()
        {
            CharactersUiController.Instance().CharacterChanged();
            ActiveCard.transform.parent        = transform;
            ActiveCard.transform.localPosition = new Vector3(_activeCardX, ActiveCard.transform.position.y);
            var tempCard = ActiveCard;

            ActiveCard.MakeNormal();
            ActiveCard = null;
            return(tempCard);
        }
示例#2
0
 private void TryToBuyCharacter(CharacterCard card)
 {
     if (GameData.Instance.CurrentGameinfo.Coins >= GameData.GetCharacterInfo(card.Character).Price)
     {
         OpenCharacter(card);
     }
     else
     {
         ShowMassageNotEnoughMoney();
     }
 }
示例#3
0
 public void InfoToCard(CharacterCard card)
 {
     if (card.IsOpen)
     {
         CharacterIcon.sprite = GameData.GetCharacterIcon(card.Character);
     }
     else
     {
         CharacterIcon.sprite = UnknownCharacterSprite;
     }
 }
示例#4
0
        private void OpenCharacter(CharacterCard card)
        {
            ulong price = GameData.GetCharacterInfo(card.Character).Price;

            GameData.Instance.CurrentGameinfo.Coins -= price;
            ChangePrice(GameData.Instance.CurrentGameinfo.Coins.ToString(), ((-1) * (int)price).ToString());
            card.IsOpen = true;
            GameData.UnlockCharacter(card.Character);
            InfoToCard(card);
            ScrollMover.Instance().ActivateCurrentCard();
        }
示例#5
0
 private void SetActiveCard(CharacterCard card)
 {
     ActiveCard   = card;
     _activeCardX = card.transform.localPosition.x;
     card.MakeBig();
     CharactersUiController.Instance().InfoToCard(card);
     if (BuyingContainer == null)
     {
         return;
     }
     if (!card.IsOpen)
     {
         BuyingContainer.SetPriceToCard(card);
         BuyingContainer.SetAsBuy();
     }
     else
     {
         BuyingContainer.SetAsPlay();
     }
 }
示例#6
0
        private void SetCoinsOpenCharacter()
        {
            if (_items == null)
            {
                // ReSharper disable once NotResolvedInText
                throw new ArgumentNullException(@"Items are not set");
            }
            foreach (Transform item in _items)
            {
                if (item.GetComponent <CharacterCard>())
                {
                    CharacterCard card = item.GetComponent <CharacterCard>();
                    card.IsOpen = !GameData.IsCharacterLocked(card.Character);
                    if (card.IsOpen)
                    {
                        item.GetComponent <CharacterCard>().SetSpriteOpen();
                    }
                }
            }
            CoinsCounterCharacterSelecter coinsCounter =
                transform.parent.gameObject.AddComponent <CoinsCounterCharacterSelecter>();

            coinsCounter.Start();
        }
示例#7
0
 public void SetPriceToCard(CharacterCard card)
 {
     MeatText.text = GameData.GetCharacterInfo(card.Character).Price.ToString();
 }