/// <summary> /// 发一张牌 有过程 /// </summary> protected override GameObject DealOnes(Transform from, Transform to, int cardValue = 0, bool isBig = false, int index = 0) { GameObject gob = Instantiate(PokerPrefab); var gobTran = gob.transform; gobTran.parent = from; gobTran.localPosition = Vector3.zero; gobTran.parent = to; gobTran.localScale = isBig ? Vector3.one * SelfCardScale : Vector3.one; var betPoker = gobTran.GetComponentInParent <BetPoker>(); betPoker.MoveCards(index); PokerCard pCard = gob.GetComponent <PokerCard>(); pCard.SetCardDepth(100 + index * 2); pCard.SetCardId(cardValue); var comp = gob.GetComponent <TweenPosition>(); comp.duration = 0.15f;//0.25f; comp.from = gob.transform.localPosition; comp.to = Vector3.zero; comp.ResetToBeginning(); comp.PlayForward(); comp.onFinished.Add(new EventDelegate (() => { pCard.TurnCard(); })); return(gob); }