예제 #1
0
    void PlayTutorial()
    {
        WaveInfo waveInfo = new WaveInfo
        {
            minNumberOfBoxes     = 1,
            maxNumberOfBoxes     = 2,
            minNumberOfDecals    = 1,
            maxNumberOfDecals    = 2,
            spawnAfterSeconds    = 0.0f,
            canSpawnGarbage      = false,
            canSpawnCrossedLabel = false
        };

        StartCoroutine(Coroutines.Chain(
                           Coroutines.Wait(2.0f),
                           tutorialCanvas.DisplayText("Hello!", 3.0f),
                           Coroutines.Wait(1.0f),
                           tutorialCanvas.DisplayText("Welcome to \"Rooster Express, Inc.\" We hope that you enjoy this job as much as we enjoy having you here!", 5.5f),
                           Coroutines.Wait(1.0f),
                           tutorialCanvas.DisplayText("Your job here will consist in picking up packages from that place over there and putting them in these conveyor belts...", 5.5f),
                           Coroutines.Wait(1.0f),
                           tutorialCanvas.DisplayText("But you have to make sure they go in the right conveyor, or some clients won't receive their packages in time.", 5.5f),
                           Coroutines.Wait(1.0f),
                           Coroutines.Join(
                               tutorialCanvas.DisplayText("Look, let's try it...", 2.0f),
                               Coroutines.Wrap(() => spawner.SpawnBoxes(waveInfo))),
                           Coroutines.Wait(2.5f),
                           Coroutines.Wrap(() => CreateTutorialBoxSpawnAndDeliver(waveInfo))
                           ));
    }
예제 #2
0
 IEnumerator CoroutineEndOk()
 {
     return(Coroutines.Chain(
                Coroutines.Join(
                    Coroutines.Wrap(() => spawner.SpawnBoxes(500, 0.01f)),
                    DisplayText("You think you are good at your job? Let's see how you handle THIS...", 4.0f)),
                Coroutines.Wait(2.0f),
                DisplayText("... Oh, wait, your turn is over. Don't worry, someone else will pick this up. See you tomorrow...", 6.0f),
                Coroutines.Wait(1.0f),
                Coroutines.Wrap(() => statisticsCanvas.gameObject.SetActive(true))));
 }
예제 #3
0
    private void SpawnWave(int wave)
    {
        int boxes  = (int)boxesSpawnedInTimeCurve.Evaluate(totalTime);
        int decals = (int)randomDecalsInTimeCurve.Evaluate(totalTime);

        WaveInfo waveInfo = new WaveInfo
        {
            canSpawnCrossedLabel = true,
            canSpawnGarbage      = true,

            minNumberOfBoxes = (int)Mathf.Floor(0.9f * boxesSpawnedInTimeCurve.Evaluate(totalTime)),
            maxNumberOfBoxes = (int)Mathf.Ceil(1.1f * boxesSpawnedInTimeCurve.Evaluate(totalTime)),

            minNumberOfDecals = (int)Mathf.Floor(0.9f * randomDecalsInTimeCurve.Evaluate(totalTime)),
            maxNumberOfDecals = (int)Mathf.Floor(1.1f * randomDecalsInTimeCurve.Evaluate(totalTime))
        };

        spawner.SpawnBoxes(waveInfo);
    }