Ejemplo n.º 1
0
    public IEnumerator HandleFlipAllForwardAnim()
    {
        isAnimating = true;
        for (int idx = curIdx; idx < allCards.Length; idx++)
        {
            RenderCard card                = allCards[idx];
            Vector3    startDestination    = startPoint.transform.localPosition + Vector3.up * cardThickness * (allCards.Length - 1 - idx),
                       endDestination      = endPoint.transform.localPosition + (Vector3.up * cardThickness * idx),
                       midPointDestination = midPoint.transform.localPosition;

            for (int x = 0; x <= 5; x++)
            {
                card.RotateCard(Vector3.forward * 15);
                card.gameObject.transform.localPosition = (midPointDestination * x + startDestination * (5 - x)) / 5f;
                yield return(null);
            }
            for (int x = 0; x <= 5; x++)
            {
                card.RotateCard(Vector3.forward * 15);
                card.gameObject.transform.localPosition = (endDestination * x + midPointDestination * (5 - x)) / 5f;
                yield return(null);
            }
            curIdx++;
        }
        yield return(null);

        isAnimating = false;
    }
Ejemplo n.º 2
0
    public IEnumerator HandleFlipBackwardsAnim()
    {
        isAnimating = true;
        if (curIdx > 0)
        {
            curIdx--;
            RenderCard card                = allCards[curIdx];
            Vector3    startDestination    = startPoint.transform.localPosition + Vector3.up * cardThickness * (allCards.Length - 1 - curIdx),
                       endDestination      = endPoint.transform.localPosition + (Vector3.up * cardThickness * curIdx),
                       midPointDestination = midPoint.transform.localPosition;
            for (int x = 0; x <= 5; x++)
            {
                card.RotateCard(Vector3.forward * -15);
                card.gameObject.transform.localPosition = (endDestination * (5 - x) + midPointDestination * x) / 5f;
                yield return(null);
            }
            for (int x = 0; x <= 5; x++)
            {
                card.RotateCard(Vector3.forward * -15);
                card.gameObject.transform.localPosition = (midPointDestination * (5 - x) + startDestination * x) / 5f;
                yield return(null);
            }
        }
        yield return(null);

        isAnimating = false;
    }
Ejemplo n.º 3
0
    void Heal()
    {
        RenderCard script = selectedTarget.GetComponent <RenderCard>();

        script.thisCard.cardHealth += 4;
        script.UpdateCard();
    }
Ejemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     for (int x = 0; x < allCards.Length; x++)
     {
         RenderCard card = allCards[x];
         card.transform.localPosition = startPoint.transform.localPosition + Vector3.up * cardThickness * (allCards.Length - 1 - x);
     }
 }
Ejemplo n.º 5
0
        // Start is called before the first frame update
        void Awake()
        {
            cardStack = new CardStack(initialFaceUp);

            render = gameObject.GetComponent <RenderCard>();
        }
Ejemplo n.º 6
0
 private void OnRenderCard()
 {
     RenderCard?.Invoke(this, null);
 }