public void ChooseCard(CardBaseComponent card)
 {
     previewComponent.ChooseCard(card);
     audioComponent.PlayClick();
     investigatorSelector.CurrentInvestigator.UpdateListAdd_Remove(card, isAdd: true);
     viewCardManager.ShowDeckCards(investigatorSelector.CurrentInvestigator);
     check.CheckingAllReady();
 }
Ejemplo n.º 2
0
 public void HidePreviewCard(CardBaseComponent card)
 {
     DOTween.Pause("backdroundLooping");
     transform.DOKill();
     imageCardPreview.sprite     = null;
     imageCardPreviewBack.sprite = null;
     background.enabled          = false;
     background2.enabled         = false;
 }
        CardBaseComponent InstantiateCard(string idCard, Zones zone, GameObject prefab)
        {
            CardBaseComponent cardMain = Instantiate(prefab, zone.zoneTransform).GetComponent <CardBaseComponent>();

            cardMain.ID = idCard;
            cardMain.DeckBuildManager     = deckBuildManager;
            cardMain.InvestigatorSelector = investigatorSelector;
            zone.zoneCards.Add(cardMain);
            return(cardMain);
        }
        public void DechooseCard(CardBaseComponent card)
        {
            CardBaseComponent cardInDeckCardsZone = Zones.dictionaryZones["DeckCards"].zoneCards.Find(c => c.ID == card.ID);

            previewComponent.DeselectCard(cardInDeckCardsZone);
            audioComponent.PlayClick();
            investigatorSelector.CurrentInvestigator.UpdateListAdd_Remove(card, isAdd: false);
            viewCardManager.ShowDeckCards(investigatorSelector.CurrentInvestigator);
            check.CheckingAllReady();
        }
        void CreatingInvestigatorCards()
        {
            List <string> InvestigatorsCards = Card.DataCard.Where(c => c.Type_code == "investigator")
                                               .OrderBy(c => c.Faction_code)
                                               .Select(c => c.Code).ToList();

            foreach (string card in InvestigatorsCards)
            {
                CardBaseComponent investigatorCard = InstantiateCard(card, Zones.dictionaryZones["InvestigatorCards"], cardPrefab);
                investigatorCard.IsInvestigator = true;
            }
        }
 public void ChooseInvestigatorCard(CardBaseComponent card)
 {
     if (investigatorSelector.InvestigatorQuantity >= GameData.MAX_INVESTIGATORS)
     {
         return;
     }
     previewComponent.ChooseInvestigator(card);
     audioComponent.PlayClick();
     investigatorSelector.AddInvestigator(card.ID);
     viewCardManager.ShowInvestigatorCards();
     viewCardManager.ShowListSelectedCards(investigatorSelector.CurrentInvestigator);
     check.CheckingAllReady();
 }
Ejemplo n.º 7
0
        public void ShowingPreviewCard(CardBaseComponent card)
        {
            transform.localScale    = Vector2.zero;
            transform.position      = card.transform.position;
            imageCardPreview.sprite = card.ImageComponent.sprite;
            background.enabled      = true;
            Vector2 positionPreview = new Vector2(card is RowCardComponent ? -1.5f : card.transform.position.x - 3.8f, 0f);

            transform.DOMove(positionPreview, timeAnimation).SetDelay(delay);
            transform.DOScale(previewScale, timeAnimation).SetDelay(delay);
            background.transform.DORotate(new Vector3(0, 0, 360), 160, mode: RotateMode.FastBeyond360).SetLoops(-1, LoopType.Yoyo).SetId("backdroundLooping").Play();

            if (card.ImageBack != null)
            {
                imageCardPreviewBack.sprite = card.ImageBack;
                background2.enabled         = true;
                background2.transform.DORotate(new Vector3(0, 0, 360), 160, mode: RotateMode.FastBeyond360).SetLoops(-1, LoopType.Yoyo).SetId("backdroundLooping").Play();
            }
        }
Ejemplo n.º 8
0
 public void UpdateListAdd_Remove(CardBaseComponent card, bool isAdd)
 {
     if (isAdd)
     {
         if (Data.IsPlaying)
         {
             Data.Xp   -= (card.Info.Xp ?? 0) == 0 ? 1 : card.Info.Xp ?? 1;
             IsPowering = false;
             SetTokens();
         }
         ListCardsID.Add(card.ID);
     }
     else
     {
         if (Data.IsPlaying)
         {
             IsPowering = true;
         }
         ListCardsID.Remove(card.ID);
     }
     Zones.dictionaryZones["DeckCards"].zoneCards.Find(c => c.ID == card.ID).PrintQuantity();
     UpdateTextNumberCards();
 }
Ejemplo n.º 9
0
 public void DeselectCard(CardBaseComponent card)
 {
     transform.DOScale(0, timeAnimation);
     transform.DOMove(card.transform.position, timeAnimation);
 }
Ejemplo n.º 10
0
 public void ChooseInvestigator(CardBaseComponent card)
 {
     transform.DOScale(0, timeAnimation);
     transform.DOMove(investigatorCard.position, timeAnimation);
 }
Ejemplo n.º 11
0
 public override void DoubleClickCard(CardBaseComponent cardBase)
 {
     DeckBuildManager.DeChooseInvestigatorCard(this);
 }
 public void HidePreviewCard(CardBaseComponent card)
 {
     previewComponent.HidePreviewCard(card);
 }
 public void ShowingPreviewCard(CardBaseComponent card)
 {
     audioComponent.PlayHover();
     previewComponent.ShowingPreviewCard(card);
 }