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); }
private void TryToBuyCharacter(CharacterCard card) { if (GameData.Instance.CurrentGameinfo.Coins >= GameData.GetCharacterInfo(card.Character).Price) { OpenCharacter(card); } else { ShowMassageNotEnoughMoney(); } }
public void InfoToCard(CharacterCard card) { if (card.IsOpen) { CharacterIcon.sprite = GameData.GetCharacterIcon(card.Character); } else { CharacterIcon.sprite = UnknownCharacterSprite; } }
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(); }
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(); } }
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(); }
public void SetPriceToCard(CharacterCard card) { MeatText.text = GameData.GetCharacterInfo(card.Character).Price.ToString(); }