コード例 #1
0
    //Cleans up level one once completed
    public void end_level()
    {
        if (Scene_Switch_Data.level == 0)
        {
            return;                                                                          //Do nothing if in tutorial mode
        }
        GameController gc = GameObject.Find("ScriptObject").GetComponent <GameController>(); //Grabs GameController script data
        GhostUtilities gu = GameObject.Find("ScriptObject").GetComponent <GhostUtilities>();
        KidUtilities   ku = GameObject.Find("ScriptObject").GetComponent <KidUtilities>();

        if (gc.level + 1 >= 4)
        {
            onMainMenuClick();                   //Sends player back to main screen when current levels completed
        }
        //Delete all ghost from ghost_list and and destroy the objects of every ghost in all regions
        for (int i = 0; i < gc.ghost_list.Count; i++)
        {
            gu.destroy_slow_symbol(i);
            Destroy(gc.ghost_list[i].ghost_object);
        }
        gc.ghost_list.Clear();
        gc.region_list.Clear();

        gc.level += 1;
        setup_level_enemies();

        for (int k = 0; k < gc.kid_list.Count; k++) //For each kid in kid_list
        {
            gc.kid_list[k].region_index = 0;
            gc.kid_list[k].region       = gc.region_list[0];
            gc.kid_list[k].region_flags_list.Clear();

            //Fill region flag list of every kid
            for (int j = 0; j < gc.region_list.Count; j++)
            {
                gc.kid_list[k].region_flags_list.Add(false);
            }

            ku.respawn(k);
        }
        gc.level_end_timer = 2.0f;
        gc.level_complete  = false;
    }
コード例 #2
0
    //Starts tutorial for player
    public void onTutorialClick()
    {
        GameController gc            = GameObject.Find("ScriptObject").GetComponent <GameController>(); //Grabs GameController script data
        KidUtilities   kid_utilities = GameObject.Find("ScriptObject").GetComponent <KidUtilities>();   //Grabs KidUtility script data

        //Make a cardie for player
        List <int> new_list = Scene_Switch_Data.character_number_list;

        new_list.Add(0);
        Scene_Switch_Data.character_number_list = new_list;
        kid_utilities.make_kid();

        //Turn on in-game mechanics
        gc.upgrade_button_on.gameObject.SetActive(true);
        gc.upgrade_text.gameObject.SetActive(true);
        gc.sprint_image.gameObject.SetActive(true);
        gc.q_text.gameObject.SetActive(true);

        //Turn on Cardie abilities and give player some points to play with
        gc.kid_list[0].sprint_available = true;
        gc.kid_list[0].upgrade_points   = 10;
    }