public void MoveInstancedCardToHand(GameObject instancedCard, Vector3 position) { CardDataTemplate cardDataTemplate = instancedCard.GetComponent <CardDataTemplate>(); Sequence sequence = DOTween.Sequence(); sequence.Append(instancedCard.transform.DOLocalMove(position, 1)); sequence.Insert(0, instancedCard.transform.DOScale(new Vector3(1f, 1f, 1f), 1)); cardDataTemplate.AddAnimationToQueue(sequence); }
public void MoveInstancedCardToDiscard(GameObject instancedCard) { CardDataTemplate cardDataTemplate = instancedCard.GetComponent <CardDataTemplate>(); Sequence sequence = DOTween.Sequence(); sequence.Append(instancedCard.transform.DOMove(discardIcon.transform.position, 1)); sequence.Insert(0, instancedCard.transform.DOScale(new Vector3(0f, 0f, 0f), 1)); cardDataTemplate.AddAnimationToQueue(sequence, true); }
public void MoveInstancedCardToDeck(GameObject instancedCard) { CardDataTemplate cardDataTemplate = instancedCard.GetComponent <CardDataTemplate>(); Sequence sequence = DOTween.Sequence(); sequence.Append(instancedCard.transform.DOScale(new Vector3(1f, 1f, 1f), 0.5f)); sequence.Append(instancedCard.transform.DOScale(new Vector3(0f, 0f, 0f), 0.5f)); sequence.Insert(0, instancedCard.transform.DOMove(deckIcon.transform.position, 1)); cardDataTemplate.AddAnimationToQueue(sequence, true); // sequence.Insert(0,instancedCard.transform.DOScale(new Vector3(0f, 0f, 0f),0.5f)); // This log will happen after the tween has completed // instancedCard.SetActive(false); // Debug.Log("Tween completed!"); }