コード例 #1
0
    public override void OnItemDropped(CardView card)
    {
        base.OnItemDropped(card);

        int siblignIndexToDrop = transform.childCount;

        if (placeholderIsActive)
        {
            siblignIndexToDrop = placeholderSiblingIndex;
        }

        placeholderIsActive = false;

        DropCard(card, siblignIndexToDrop);

        //card.transform.DOKill();

        /*card.transform.DOLocalMove(GetPositionForChild(card.transform.GetSiblingIndex()), cardDropSpeed).OnKill(() => {
         *  scrollableComponent.OnChildAdded(card.SpriteRenderer);
         * });*/
        card.KillAnimation();
        card.MoveTo(GetPositionForChild(card.transform.GetSiblingIndex()), cardDropSpeed).OnComplete(() =>
        {
            scrollableComponent.OnChildAdded(card.SpriteRenderer);
        });
    }
コード例 #2
0
ファイル: PreviewZone.cs プロジェクト: mucsirobert/Card_app
 //This is called when the cards are in the correct position, after a delay due to the animation
 private void OnCardsReady()
 {
     foreach (Transform previewCard in cardHolderTransform)
     {
         scrollableComponent.OnChildAdded(previewCard.GetComponent <SpriteRenderer>());
     }
     scrollableComponent.InitButtons();
 }