Exemplo n.º 1
0
    IEnumerator CardShowingStage()
    {
        taskText.text = StringRes.Get("_MotionMemorizeHouse");

        yield return(timer.SimpleTimer(3f));

        yield return(timer.SimpleTimer(conf.timeBetweenCardsShowing));

        int remainingGroupSize = unsolved.Count < conf.maxGroupSize ? unsolved.Count : conf.maxGroupSize;

        for (int i = 0; i < remainingGroupSize; i++)
        {
            MemoryCardHouse card = unsolved[GetRandom(unsolved.Count)];
            windowController.BeginOutline(card);
            windowController.BeginShowPose(card);

            yield return(windowController.OpenWindows(card.index, WINDOW_ANIM_TIME));

            //wait for minimum accuracy or minimum time to pass

            progressBar.enabled = true;
            yield return(timer.UITimer(conf.cardShowingTime, progressBarMask, remainingTimeText));

            progressBar.enabled = false;
            yield return(windowController.CloseWindows(card.index, WINDOW_ANIM_TIME));

            windowController.StopShowPose(card);
            windowController.StopOutline(card);

            tempStack.Add(card);
            unsolved.Remove(card);
            if (i < remainingGroupSize)
            {
                yield return(timer.SimpleTimer(conf.timeBetweenCardsShowing));
            }
        }
    }