Beispiel #1
0
    private void FillLevelEvents(int level)
    {
        timedLevelEvents.Clear();
        stepLevelEvents.Clear();

        switch (level)
        {
        //Menu
        case 0:
            AddTimedEvent(0f, () =>
            {
                CreateObject("Clouds");
            });
            break;

        //Tutorial
        case 1:
            AddTimedEvent(0f, () =>
            {
                CreateObject("Stars");
                sunAnimator.SetBool("isNight", true);
                speckManager = CreateObject("SpeckManager").GetComponent <SpeckManager>();
            });
            AddTimedEvent(0f, () => { SpawnManager.Instance.ActivateLevelSpawners(Spawner.Type.Step); });
            AddTimedEvent(2f, () => { speckManager.ActivateSpecks(stepTransforms[0]); });

            stepLevelEvents.Add(new LevelEvent(false, 3, () =>
            {
                Debug.Log("Trigger Night");
                speckManager.DeactivateSpecks();
                sunAnimator.SetBool("isNight", false);
                AddTimedEvent(Time.time + 2f, () => { SpawnManager.Instance.ResetLevelSpawners(Spawner.Type.Step); });
                AddTimedEvent(Time.time + 3f, () => { overlay2.Lift(); sunAnimator.SetBool("isBlack", true); sunAnimator.SetBool("isNight", true); });
                AddTimedEvent(Time.time + 3.5f, () => { AudioManager.Instance.PlayForAll(AudioManager.Instance.splashSound); lava.LiftHeat(true); });
                AddTimedEvent(Time.time + 5f, () => { EndLevel(false); });
            }));
            break;

        //Pot
        case 2:
            //AddTimedEvent(2f, () => { SpawnManager.Instance.Pull(-Vector2.up, 1f); });
            //timedLevelEvents.Add(new LevelEvent(true, 5f, () => { Instantiate(aiPrefab); }));
            //stepLevelEvents.Add(new LevelEvent(false, 2f, () => { SpawnManager.Instance.SpawnFromAll(Spawner.Type.Scenery, Vector2.up, 0); SpawnManager.Instance.ActivateScenerySpawners(); }));

            /*stepLevelEvents.Add(new LevelEvent(false, 20f, () =>
             * {
             * Flash();
             * EndLevel(false, true);
             * StartCoroutine(overlay1.Lower(1f));
             * AudioManager.Instance.PlayIn(1f, AudioManager.Instance.splashSound);
             * }));*/
            break;

        //Kitchen
        case 3:
            AddStepEvent(2, () => { SpawnManager.Instance.ActivateLevelSpawners(Spawner.Type.Scenery); });
            break;
        }
    }