コード例 #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;
    }
コード例 #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;
    }
コード例 #3
0
ファイル: CardList.cs プロジェクト: Ramzar11k/Imperius
    void Heal()
    {
        RenderCard script = selectedTarget.GetComponent <RenderCard>();

        script.thisCard.cardHealth += 4;
        script.UpdateCard();
    }
コード例 #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);
     }
 }
コード例 #5
0
ファイル: Deck.cs プロジェクト: rishitkhare/Card-Games
        // Start is called before the first frame update
        void Awake()
        {
            cardStack = new CardStack(initialFaceUp);

            render = gameObject.GetComponent <RenderCard>();
        }
コード例 #6
0
 private void OnRenderCard()
 {
     RenderCard?.Invoke(this, null);
 }