Esempio n. 1
0
        // ポイントを加えるアニメーションの実体
        IEnumerator DoAnimation()
        {
            isAnimation = true;
            cameraAnimator.MoveToTarget(2f);
            UserQueueData userQueueData = userQueue.Dequeue();

            cameraAnimator.ChangeTarget(userQueueData.user.GetPosition());
            yield return(new WaitForSeconds(2f));

            float t;

            while (true)
            {
                t = Mathf.Max(Mathf.Exp(-userQueue.Count * 0.5f) * 1.3f, 0.2f);
                userQueueData.user.AddScore(userQueueData.genre, userQueueData.score, t);
                notificationManager.Add(userQueueData.user.name, userQueueData.genre, userQueueData.score);
                yield return(new WaitForSeconds(t));

                if (userQueue.Count == 0)
                {
                    break;
                }
                userQueueData = userQueue.Dequeue();
                cameraAnimator.ChangeTarget(userQueueData.user.GetPosition());
            }
            cameraAnimator.LeaveFromTarget(1f);
            yield return(new WaitForSeconds(1f));

            if (userQueue.Count >= 1)
            {
                yield return(DoAnimation());
            }
            isAnimation = false;
        }