コード例 #1
0
    void HandleStageTransition()
    {
        stage_elapsed -= Time.deltaTime;

        if (stage_elapsed < 0)
        {
            stage_elapsed = stage_interval;

            switch (stage)
            {
            case Stage.basic_control:
                stage = Stage.lets_draw;
                state = State.fading_out;
                break;

            case Stage.paddle_drawn:
                stage = Stage.paddle_drawn_2;
                state = State.fading_out;
                break;

            case Stage.paddle_drawn_2:
                stage = Stage.paddle_drawn_3;
                state = State.fading_out;
                break;

            case Stage.paddle_drawn_3:
                stage = Stage.paddle_drawn_4;
                state = State.fading_out;
                break;

            case Stage.paddle_drawn_4:
                game_manager.InitializeBreakshot();
                stage = Stage.paddle_drawn_5;
                state = State.fading_out;
                break;

            case Stage.paddle_drawn_5:
                stage = Stage.with_breakshot;
                state = State.fading_out;

                foreach (ScoreTracker st in FindObjectsOfType <ScoreTracker>())
                {
                    st.SetGameHasStarted(true);
                }
                break;

            case Stage.more_challenge:
                stage = Stage.more_challenge_2;
                state = State.fading_out;
                break;

            case Stage.more_challenge_2:
                stage = Stage.more_challenge_3;
                state = State.fading_out;
                break;

            case Stage.more_challenge_3:
                stage = Stage.more_challenge_4;
                state = State.fading_out;
                break;

            case Stage.more_challenge_4:
                stage = Stage.more_challenge_5;
                state = State.fading_out;
                game_manager.InitializeFakePaddles();
                break;

            case Stage.getting_the_hang:
                stage = Stage.getting_the_hang_2;
                state = State.fading_out;
                break;

            case Stage.getting_the_hang_2:
                next_button.SetActive(true);
                stage = Stage.getting_the_hang_3;
                state = State.fading_out;
                break;
            }
        }
    }
コード例 #2
0
    void HandleStageTransition()
    {
        stage_elapsed -= Time.deltaTime;

        if (stage_elapsed < 0)
        {
            stage_elapsed = stage_interval;

            switch (stage)
            {
            case Stage.intro:
                game_manager.InitializePowerUpSpawner();
                stage = Stage.see_that;
                state = State.fading_out;
                foreach (ScoreTracker st in FindObjectsOfType <ScoreTracker>())
                {
                    st.SetGameHasStarted(true);
                }

                break;

            case Stage.see_that:
                stage = Stage.try_shooting;
                state = State.fading_out;
                break;

            case Stage.try_shooting:
                game_manager.InitializeBreakshot();
                touch_detection.DisableForNextGesture(false);
                stage = Stage.try_shooting_2;
                state = State.fading_out;
                break;

            case Stage.try_shooting_2:
                stage = Stage.try_shooting_3;
                state = State.fading_out;
                break;

            case Stage.watch_collected:
                stage = Stage.watch_collected_2;
                state = State.fading_out;
                break;

            case Stage.watch_collected_2:
                stage = Stage.watch_collected_3;
                state = State.fading_out;
                break;

            case Stage.watch_collected_3:
                stage = Stage.watch_collected_4;
                state = State.fading_out;
                sprite_renderer.enabled = true;
                gesture_detector.DisableTemporarily(false);
                powerup_manager.allow_reinforced = true;
                break;

            case Stage.reinforced:
                stage = Stage.reinforced_2;
                state = State.fading_out;
                break;

            case Stage.reinforced_2:
                stage = Stage.reinforced_3;
                state = State.fading_out;
                break;

            case Stage.reinforced_3:
                stage = Stage.reinforced_4;
                state = State.fading_out;
                break;

            case Stage.reinforced_4:
                next_button.SetActive(true);
                stage = Stage.reinforced_5;
                state = State.fading_out;
                break;

            case Stage.triple_shot_intro:
                stage = Stage.triple_shot_1;
                state = State.fading_out;
                break;

            case Stage.triple_shot_1:
                stage = Stage.triple_shot_2;
                state = State.fading_out;
                break;

            case Stage.triple_shot_2:
                powerup_meter.FillToFull();
                GameObject.Find("slide_up_gesture").GetComponent <SpriteRenderer>().enabled = true;
                powerup_manager.allow_triple_shot = true;
                stage = Stage.triple_shot_3;
                state = State.fading_out;
                break;

            case Stage.triple_shot_3:
                break;

            case Stage.triple_launched:
                stage = Stage.triple_launched_2;
                state = State.fading_out;
                break;

            case Stage.triple_launched_2:
                stage = Stage.triple_launched_3;
                state = State.fading_out;
                break;

            case Stage.triple_launched_3:
                next_button.SetActive(true);
                stage = Stage.triple_launched_4;
                state = State.fading_out;
                break;

            case Stage.triple_launched_4:
                stage = Stage.triple_launched_5;
                state = State.fading_out;
                break;

            case Stage.defensive_intro:
                game_manager.InitializeFakePaddles();
                powerup_meter.FillToFull();
                stage = Stage.defensive_intro_2;
                state = State.fading_out;
                break;

            case Stage.defensive_intro_2:
                powerup_manager.allow_safety       = true;
                sprite_renderer.transform.position = new Vector3(4.15f, sprite_renderer.transform.position.y, 0);
                sprite_renderer.enabled            = true;
                GameObject go_slide_up = GameObject.Find("slide_up_gesture");
                go_slide_up.transform.rotation = Quaternion.Euler(0, 0, 180);
                go_slide_up.GetComponent <SpriteRenderer>().enabled = true;
                stage = Stage.defensive_intro_3;
                state = State.fading_out;
                break;

            case Stage.defensive_intro_3:

                break;

            case Stage.safe_activated:

                stage = Stage.safe_activated_1;
                state = State.fading_out;
                break;

            case Stage.safe_activated_1:
                next_button.SetActive(true);
                stage = Stage.safe_activated_2;
                state = State.fading_out;
                break;

            case Stage.safe_activated_2:
                stage = Stage.safe_activated_3;
                state = State.fading_out;
                break;

            case Stage.safe_activated_3:
                break;

            case Stage.supercharge_intro_2:
                stage = Stage.supercharge_intro_3;
                state = State.fading_out;
                break;

            case Stage.supercharge_intro_3:
                stage = Stage.supercharge_intro_4;
                state = State.fading_out;
                break;

            case Stage.supercharge_intro_4:
                next_button.GetComponentInChildren <Text>().text = "Quick Play";
                next_button.SetActive(true);
                quit_button.SetActive(true);
                stage = Stage.supercharge_intro_5;
                state = State.fading_out;
                break;
            }
        }
    }