Пример #1
0
        private static void CorrectDeck2_AddItemToHand()
        {
            string cardname = "apollobow";

            CardManager.Card chosenCard = null;

            foreach (CardManager.Card card in Game.instance.currentDeck)
            {
                if (card.name.Equals(cardname))
                {
                    chosenCard = card;
                    break;
                }
            }

            foreach (CardManager.Card card in Game.instance.reserveDeck)
            {
                if (card.name.Equals(cardname))
                {
                    chosenCard = card;
                    break;
                }
            }



            if (chosenCard != null)
            {
                Game.instance.currentDeck.Remove(chosenCard);
                SameDistanceChildren distance = Visual.instance.TreasureHand.GetComponent <SameDistanceChildren>();
                int        emptySlotIndex     = distance.GetOccupiedSlotsNumber();
                GameObject treasureslot       = distance.slots[emptySlotIndex];
                OneCardManager.CreateOneCardManager(chosenCard, treasureslot);
            }
        }
    private IEnumerator PrepareCardForNewGameCoroutine()
    {
        TestTools.DeckCorrection();
        new WaitForSeconds(.01f);
        foreach (CardManager.Card card in Game.instance.currentDeck)
        {
            GameObject cardPoint  = Visual.instance.CardPointOutside;
            GameObject cardObject = OneCardManager.CreateOneCardManager(card, cardPoint);
        }
        yield return(new WaitForSeconds(.01f));

        Command.CommandExecutionComplete();
    }
Пример #3
0
    public void FillByCards(List <CardManager.Card> cards)
    {
        VisualTool.RemoveChildrensFromTransform(CardListContent.transform);

        foreach (CardManager.Card VARIABLE in cards)

        {
            GameObject    slot      = Instantiate(Visual.instance.prefabBasicRect, CardListContent.transform);
            RectTransform transform = slot.GetComponent <RectTransform>();
            VisualTool.SetAnchorPreset(transform);

            GameObject cmObject = OneCardManager.CreateOneCardManager(VARIABLE, slot);
            VisualTool.SetAnchorPreset(cmObject.GetComponent <RectTransform>());
        }
    }
Пример #4
0
        public static void TestCardMove()
        {
            CardManager.Instance().Init();
            CardManager.Instance().Shuffle();

            float duration = 1f;

            CardManager.Card c;

            //for (int i = 0; i < CardManager.Instance().shuffledList.Count; i++)
            for (int i = 0; i < 2; i++)
            {
                GameObject cardPoint = Visual.instance.CardPointOutside;
                c = CardManager.Instance().shuffledList[i];

                GameObject cardObject = OneCardManager.CreateOneCardManager(c, cardPoint);

                MoveCardToAnotherParent(cardObject, Visual.instance.CardDeckFrame.transform);
            }
        }
Пример #5
0
        public static void TestFillDeckOld()
        {
            CardManager.Instance().Init();
            CardManager.Instance().Shuffle();

            float duration = .5f;

            CardManager.Card c;

            Sequence s = DOTween.Sequence();



            List <GameObject> shuffledCards = new List <GameObject>();

            //for (int i = 0; i < CardManager.Instance().shuffledList.Count; i++)
            for (int i = 0; i < 5; i++)
            {
                GameObject cardPoint = Visual.instance.CardPointOutside;
                c = CardManager.Instance().shuffledList[i];

                GameObject cardObject = OneCardManager.CreateOneCardManager(c, cardPoint);

                SetCanvasOrderInObject(cardObject, i);


                shuffledCards.Add(cardObject);

                s.Append(cardObject.transform.DOMove(Visual.instance.CardDeckFrame.transform.position, duration)).SetEase(Ease.Flash);
                s.Join(cardObject.transform.DORotate(new Vector3(0f, 179f, 0f), duration));
            }
            s.onComplete = () =>
            {
                foreach (GameObject go in shuffledCards)
                {
                    go.transform.SetParent(Visual.instance.CardDeckFrame.transform);
                }
            };

            s.Play();
        }
    private IEnumerator PrepareCardForNewGameCoroutine()
    {
        foreach (CardManager.Card card in Game.instance.currentDeck)
        {
            GameObject cardObject = OneCardManager.CreateOneCardManager(card, Visual.instance.CardDeckFrame);
            cardObject.transform.DORotate(new Vector3(0f, 179f, 0f), 0);
        }



        SameDistanceChildren distance = Visual.instance.CurrentEncounter.GetComponent <SameDistanceChildren>();

        foreach (CardManager.Card card in Game.instance.currentEncounter)
        {
            int        index      = Game.instance.currentEncounter.IndexOf(card);
            GameObject slot       = distance.slots[index];
            GameObject cardObject = OneCardManager.CreateOneCardManager(card, slot);
        }

        SameDistanceChildren treasureHand = Visual.instance.TreasureHand.GetComponent <SameDistanceChildren>();

        foreach (CardManager.Card card in Game.instance.TreasureHand)
        {
            int        index      = Game.instance.TreasureHand.IndexOf(card);
            GameObject slot       = treasureHand.slots[index];
            GameObject cardObject = OneCardManager.CreateOneCardManager(card, slot);
        }

        foreach (Effect effect in Game.instance.CardEffects)
        {
            GameObject effectActorObject = EffectActor.CreateNewEffectActor(effect);
        }

        yield return(new WaitForSeconds(.01f));

        GameLogicEvents.eventUpdateCurrentEncounter.Invoke();
        Command.CommandExecutionComplete();
    }
Пример #7
0
        private static IEnumerator FillDeckCoroutine()
        {
            CardManager.Instance().Init();
            CardManager.Instance().Shuffle();

            float duration = .5f;

            CardManager.Card c;


            List <GameObject> shuffledCards = new List <GameObject>();
            //for (int i = 0; i < CardManager.Instance().shuffledList.Count; i++)


            int shuffledCardNumber = 30;

            float smallAmountOfTime = .01f;
            float moveCardDuration  = 0.5f;

            for (int i = 0; i < shuffledCardNumber; i++)
            {
                GameObject cardPoint = Visual.instance.CardPointOutside;
                c = CardManager.Instance().shuffledList[i];
                GameObject cardObject = OneCardManager.CreateOneCardManager(c, cardPoint);
                SetCanvasOrderInObject(cardObject, i);

                MoveCardToAnotherParent(cardObject, Visual.instance.CardDeckFrame.transform);
                //shuffledCards.Add(cardObject);

                yield return(new WaitForSeconds(smallAmountOfTime));
            }
            ;
            yield return(new WaitForSeconds(shuffledCardNumber * smallAmountOfTime + moveCardDuration));

            Debug.Log("End FillDeckCoroutine");
        }
Пример #8
0
 public void SetCurrentDiceEncounterObject()
 {
     CardManager.Card diceEncounterCard = Visual.instance.GetCurrentEnemyCard();
     currentDiceEncounterObject         = OneCardManager.CreateOneCardManager(diceEncounterCard, Visual.instance.currentDiceEncounter);
     currentDiceEncounterOneCardManager = currentDiceEncounterObject.GetComponent <OneCardManager>();
 }