Esempio n. 1
0
    public void Continue_no(bool call_defeat_screen)
    {
        if (game_uGUI.current_game_uGUI.show_debug_messages)
        {
            Debug.Log("Continue_no()");
        }

        if (call_defeat_screen)
        {
            Time.timeScale = initial_time_scale;
            can_take_input = false;
        }

        if (my_game_master.if_player_not_continue_selected == game_master.if_player_not_continue.restart_from_W1_Stage_1)
        {
            if (game_uGUI.current_game_uGUI.show_debug_messages)
            {
                Debug.Log("Reset_all_worlds");
            }

            if (my_game_master.continue_rule_selected == game_master.continue_rule.continue_cost_a_continue_token)
            {
                my_game_master.current_continue_tokens[my_game_master.current_profile_selected] = my_game_master.start_continue_tokens;
            }

            my_game_master.Reset_all_worlds();
        }
        else if (my_game_master.if_player_not_continue_selected == game_master.if_player_not_continue.restart_from_current_world_Stage_1)
        {
            if (game_uGUI.current_game_uGUI.show_debug_messages)
            {
                Debug.Log("Reset_current_world if the playar not have already completed it");
            }
            if (my_game_master.current_world[my_game_master.current_profile_selected] == my_game_master.play_this_stage_to_progress_in_the_game_world[my_game_master.current_profile_selected])
            {
                my_game_master.Reset_current_world(my_game_master.current_world[my_game_master.current_profile_selected], true);
                my_game_master.play_this_stage_to_progress_in_the_game_world[my_game_master.current_profile_selected] = my_game_master.current_world[my_game_master.current_profile_selected];
                my_game_master.play_this_stage_to_progress_in_the_game_stage[my_game_master.current_profile_selected] = 0;
            }
        }
        else if (my_game_master.if_player_not_continue_selected == game_master.if_player_not_continue.restart_from_current_world_and_current_stage)
        {
            if (game_uGUI.current_game_uGUI.show_debug_messages)
            {
                Debug.Log("restart from here");
            }
        }

        if (my_game_master.when_restart_selected == game_master.when_restart.give_lives_after_countdown)
        {
            my_game_master.Set_date_countdown();
        }

        //my_game_master.current_lives[my_game_master.current_profile_selected] = my_game_master.if_not_continue_restart_with_lives;

        my_game_master.refresh_stage_and_world_screens = true;
        my_game_master.Save(my_game_master.current_profile_selected);

        this.gameObject.SetActive(false);

        if (call_defeat_screen && (my_game_master.lose_lives_selected == game_master.lose_lives.in_game))
        {
            game_uGUI.current_game_uGUI.Defeat();
        }
    }