Esempio n. 1
0
        public override void Add(BaseCard card)
        {
            this.Cards.Add(card);
            card.Enable();

            card.transform.parent = this.transform;

            var cardPos = this.GetTargetPositionForCard(card);

            Vector3 cardPreviewPos = cardPos;

            cardPreviewPos.z -= 20f;

            var previewTween = new MoveTween
            {
                Target             = card.gameObject,
                Position           = cardPreviewPos,
                Time               = 0.35f,
                Flip               = FlipState.FaceUp,
                Rotate             = TweenRotationType.NoRotate,
                OnCompleteCallback = () => card.State = State.Discarded
            };

            var finalTween = new MoveTween
            {
                Target             = card.gameObject,
                Position           = cardPos,
                Time               = 0.25f,
                Flip               = FlipState.FaceUp,
                Rotate             = TweenRotationType.NoRotate,
                OnCompleteCallback = () => card.State = State.Discarded
            };

            GameManager.TweenQueue.AddTweenToQueue(previewTween);
            GameManager.TweenQueue.AddTweenToQueue(finalTween);

            this.MoveToThisCollection(card);
        }