public IEnumerator CardAdded(GameObject card, int currentPlayerIndex, Text StartPos, Vector3 endPos) { card.transform.GetChild(1).gameObject.SetActive(true); card.transform.position = StartPos.transform.position; float elapsedTime = 0; float waitTime = 1.5f; endPos.Set(gameObject.GetComponent <HandArranger>().GetX(currentPlayerIndex), gameObject.GetComponent <HandArranger>().GetY(currentPlayerIndex), 10f); while (elapsedTime < waitTime) { float fraction = TranslateHelper.GetFraction(elapsedTime, waitTime, "CubicOutBack"); card.transform.position = card.transform.position * (1 - fraction) + (endPos * fraction); elapsedTime += Time.deltaTime; yield return(null); } card.transform.GetChild(1).gameObject.SetActive(false); yield break; }