Пример #1
0
        protected IEnumerator CardMove(JhCard card, Vector3 start, Vector3 end)
        {
            float time = 0;

            while (true)
            {
                time += Time.deltaTime;

                if (time > FlyTime)
                {
                    card.transform.position   = end;
                    card.transform.localScale = Vector3.one;
//                    if (OnOneFinish != null)
//                    {
//                        OnOneFinish.parameters[0] = new EventDelegate.Parameter(card);
//                        OnOneFinish.Execute();
//                    }
                    break;
                }

                card.transform.position   = Vector3.Lerp(start, end, time / FlyTime);
                card.transform.localScale = new Vector3(0.5f + 0.5f * time / FlyTime, 0.5f + 0.5f * time / FlyTime, 1);
                yield return(1);
            }
        }
Пример #2
0
        protected IEnumerator CardSend(List <List <JhCard> > cards, List <List <Vector3> > posList, int start)
        {
            int cnt = cards.Count;

            for (int index = 0; index < cards[0].Count; index++)
            {
                int loop = start;
                while (true)
                {
                    JhCard card = cards[loop][index];
                    card.StartCoroutine(CardMove(card, StartPos, posList[loop][index]));
                    yield return(new WaitForSeconds(IntervalTime));

                    loop = (loop + 1) % cnt;
                    if (loop == start)
                    {
                        break;
                    }
                }
            }


            yield return(new WaitForSeconds(FlyTime));

            if (OnFinish != null)
            {
                OnFinish.Execute();
            }
        }