Esempio n. 1
0
 //cardList의 모든 카드를 각각의 targetPos로 이동시키고 angle만큼 회전시킨다.
 public void SortAllCard()
 {
     for (int i = 0; i < cardList.Count; i++)
     {
         SetAngleToCard(i);
         SetCurveRate(i);
         SortCard(0.3f, i);
         StartCoroutine(ObjectControl.RotationToC(0.1f, new Vector3(0f, 0f, ObjectControl.RotationAngle(cardList[i].gameObject, cardList[i].angle)), cardList[i].gameObject));
     }
 }
Esempio n. 2
0
    //time 시간동안 Card를 베지어 곡선에 따라 이동하여, 뽑을 카드 더미에 card.init 데이터를 전달한 후, card.GameObject를 Destroy한다.
    private IEnumerator ReloadCardC(float time, Card card)
    {
        float   h    = Random.Range(-2, 3) * 80;
        float   addH = 3 * 80;
        float   x    = discardPile.transform.localPosition.x + (deck.transform.localPosition.x - discardPile.transform.localPosition.x) / 5;
        Vector3 r1   = new Vector3(x, discardPile.transform.localPosition.y + addH + h, 0f);
        Vector3 r2   = new Vector3(x, discardPile.transform.localPosition.y + addH, 0f);

        StartCoroutine(ObjectControl.RotationToC(time, new Vector3(0f, 0f, ObjectControl.RotationAngle(card.gameObject, 120f)), card.gameObject));
        yield return(StartCoroutine(ObjectControl.CurveMoveObjC(time, discardPile.transform.localPosition, r1, r2, deck.transform.localPosition, card.gameObject)));

        deck.AddToPile(card.init);
        Destroy(card.gameObject, 0.5f);
    }
Esempio n. 3
0
    //생성된 카드를 베지어 곡선에 따라 이동시킨다.
    private IEnumerator DrawCardC(float time, int index)
    {
        StartCoroutine(ObjectControl.RotationToC(0.3f, new Vector3(0f, 0f, -180f), cardList[index].gameObject));
        SetCurveRate(index);
        cardList[index].targetPos = Curve.BezierCurve(cardList[index].handCurveRate, handP0.localPosition, handP1.localPosition, handP2.localPosition, handP3.localPosition);

        StartCoroutine(ObjectControl.ChangeSizeC(0.3f, new Vector3(cardMaxSize, cardMaxSize, 0.0f), cardList[index].gameObject));
        yield return(StartCoroutine(ObjectControl.CurveMoveObjC(time, deck.transform.localPosition, drawP1.localPosition, drawP2.localPosition, cardList[index].targetPos, cardList[index].gameObject)));

        StartCoroutine(cardList[index].SetActiveOfTrailC(0.3f, false));

        //손패 정렬 실행.
        SortAllCard();
        endDrawCount++;
    }
Esempio n. 4
0
    //손패의 모든 카드를 버리고 리스트를 비운 다음 드로우 루틴을 실행.
    private IEnumerator DropAllCardC()
    {
        float time = 0.7f;

        foreach (Card card in cardList)
        {
            StartCoroutine(ObjectControl.ChangeSizeC(time, new Vector3(cardMinSize, cardMinSize, 0f), card.gameObject));
            StartCoroutine(ObjectControl.RotationToC(time, new Vector3(0f, 0f, ObjectControl.RotationAngle(card.gameObject, -180f)), card.gameObject));
            StartCoroutine(DropCardC(time, card, card.transform.localPosition, dropP1.localPosition, dropP2.localPosition, discardPile.transform.localPosition));
        }
        if (cardList.Count > 0)
        {
            yield return(new WaitForSeconds(time + 0.5f));
        }
        cardList.Clear();
        StartCoroutine(DrawRoutineC());
    }
Esempio n. 5
0
    /// <summary>
    /// time 시간동안 cardList의 index에 해당하는 카드를 현재 위치에서 discardPile의 위치로 베지어 곡선을 따라 이동시킨다.
    /// </summary>
    public void DropCard(float time, int index)
    {
        Card card = cardList[index];

        cardList.RemoveAt(index);

        for (int i = card.order; i < cardList.Count; i++)
        {
            cardList[i].order--;
        }

        float y = 100f;
        float x = (discardPile.transform.localPosition.x - card.transform.localPosition.x) / 3;

        Vector3 p1 = new Vector3(card.transform.localPosition.x + x, card.transform.localPosition.y + y, 0f);
        Vector3 p2 = new Vector3(card.transform.localPosition.x + x * 2, card.transform.localPosition.y + y, 0f);

        StartCoroutine(ObjectControl.ChangeSizeC(time, new Vector3(cardMinSize, cardMinSize, 0f), card.gameObject));
        StartCoroutine(ObjectControl.RotationToC(time, new Vector3(0f, 0f, ObjectControl.RotationAngle(card.gameObject, -180f)), card.gameObject));
        StartCoroutine(DropCardC(time, card, card.transform.localPosition, p1, p2, discardPile.transform.localPosition));
    }