예제 #1
0
 public void Focus_on_first_icon()
 {
     my_manage_menu_uGUI.world_screen_target_button = world_icons[0].gameObject;
     if (this.gameObject.activeSelf)
     {
         my_manage_menu_uGUI.Mark_this_button(my_manage_menu_uGUI.world_screen_target_button);
     }
 }
예제 #2
0
 void Next()
 {
     if (target_position < how_many_elements - 1)
     {
         target_position++;
         my_manage_menu_uGUI.Update_page_dot(target_position);
         StartCoroutine(Move_to(my_scrollRect.normalizedPosition, new Vector2(useful_positions[target_position], my_scrollRect.normalizedPosition.y), my_scrollRect.elasticity));
         my_manage_menu_uGUI.Mark_this_button(my_manage_menu_uGUI.first_stage_ico_in_this_page[target_position]);
     }
 }
예제 #3
0
    void Return_to_previous_screen()
    {
        this.gameObject.SetActive(false);
        my_manage_menu_uGUI.current_screen.gameObject.SetActive(true);

        if (my_manage_menu_uGUI.current_screen == my_manage_menu_uGUI.home_screen)
        {
            my_manage_menu_uGUI.Mark_this_button(select_this_button_when_close_me);
        }
        else if (my_manage_menu_uGUI.current_screen == my_manage_menu_uGUI.profile_screen)
        {
            my_manage_menu_uGUI.Mark_this_button(select_this_button_when_close_me);
        }
    }
예제 #4
0
    public void Click_me()
    {
        if (my_padlock.enabled)         //you can't go in this world yet
        {
            if (!GetComponent <Animation>().isPlaying)
            {
                my_game_master.Gui_sfx(my_game_master.tap_error_sfx);

                GetComponent <Animation>().Play("tap_icon_error");
            }
        }
        else         //open stage screen of this world
        {
            my_game_master.Gui_sfx(my_game_master.tap_sfx);
            my_game_master.current_world[my_game_master.current_profile_selected] = my_number;
            if (my_game_master.stage_screen_generation_selected == game_master.stage_screen_generation.automatic)
            {
                my_manage_menu_uGUI.Go_to_this_world_stage_menu(my_number);
            }
            else if (my_game_master.stage_screen_generation_selected == game_master.stage_screen_generation.manual)
            {
                if (my_game_master.show_debug_messages)
                {
                    Debug.Log("manual stage creation");
                }
                my_manage_menu_uGUI.worlds_screen_automatic.gameObject.SetActive(false);
                my_manage_menu_uGUI.worlds_screen_manual.gameObject.SetActive(false);
                my_manage_menu_uGUI.Mark_current_screen(my_manage_menu_uGUI.stages_screen_manual[my_number]);
                my_manage_menu_uGUI.Mark_this_button(my_manage_menu_uGUI.stage_screen_target_button);
            }
        }
    }
예제 #5
0
    void Focus_on_first_button_of_this_window()
    {
        GameObject target = windows[tab_selected].transform.GetChild(0).transform.GetChild(0).transform.GetChild(0).gameObject;

        if (target)
        {
            my_manage_menu_uGUI.Mark_this_button(target);
        }
    }
예제 #6
0
    void Update_page()
    {
        int current_page = my_game_master.current_world[my_game_master.current_profile_selected];

        //set page name and background
        current_page_name.text = my_game_master.world_name[current_page];
        //Debug.Log("current_page " + current_page);
        if (current_page < world_bk.Length)
        {
            my_bk.sprite = world_bk[current_page];
        }

        //show_arrows
        if (current_page == 0)
        {
            previous_button.SetActive(false);
        }
        else
        {
            previous_button.SetActive(true);
        }

        if (current_page == my_game_master.total_stages_in_world_n.Length - 1)
        {
            next_button.SetActive(false);
        }
        else
        {
            next_button.SetActive(true);
        }

        //update icons
        for (int i = 0; i < stage_icons.Length; i++)
        {
            if (i < my_game_master.total_stages_in_world_n[my_game_master.current_world[my_game_master.current_profile_selected]])
            {
                stage_icons[i].gameObject.SetActive(true);
                stage_icons[i].world_number        = current_page;
                stage_icons[i].stage_number        = i + 1;
                stage_icons[i].my_manage_menu_uGUI = my_manage_menu_uGUI;
                stage_icons[i].my_game_master      = my_game_master;
                stage_icons[i].My_start();
            }
            else
            {
                stage_icons[i].gameObject.SetActive(false);
            }
        }

        my_manage_menu_uGUI.stage_screen_target_button = stage_icons[0].gameObject;
        if (this.gameObject.activeSelf)
        {
            my_manage_menu_uGUI.Mark_this_button(my_manage_menu_uGUI.stage_screen_target_button);
        }
    }
예제 #7
0
 void Focus_on_first_icon()
 {
     if (my_world_number == my_game_master.current_world[my_game_master.current_profile_selected])
     {
         my_manage_menu_uGUI.stage_screen_target_button = stage_icons[0].gameObject;
         if (this.gameObject.activeSelf)
         {
             my_manage_menu_uGUI.Mark_this_button(my_manage_menu_uGUI.stage_screen_target_button);
         }
     }
 }
예제 #8
0
	public void My_start()
	{
		manager_linear_map_obj = this.gameObject;
		DontDestroyOnLoad(manager_linear_map_obj);

		if (stage_icons.Length > 0)
			{
			if (game_master.game_master_obj)
				my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master");
		
			my_manage_menu_uGUI = GameObject.Find("Home_Canvas").GetComponent<manage_menu_uGUI>();
		
			if (my_game_master.press_start_and_go_to_selected == game_master.press_start_and_go_to.map)//if the map is in use
				{
				if (my_game_master.total_number_of_stages_in_the_game != stage_icons.Length)
					{
						Debug.LogError("the number of icons don't match the total number of stages in the game");
					}
				else
					{
					int temp_current_world = 0;
					int temp_stage_conut = 1;
					for (int i = 0; i < stage_icons.Length; i++)
						{
						//check if this stage icon belong to this world of if you must pass to next world
						if (temp_stage_conut  <= my_game_master.total_stages_in_world_n[temp_current_world])
							{
							//Debug.Log("same world " + temp_current_world +","+temp_stage_conut);
							Update_this_icon(i,temp_current_world,temp_stage_conut);
							temp_stage_conut++;
							}
						else//next world
							{
							temp_current_world++;
							temp_stage_conut = 1;
							//Debug.Log("new world " + temp_current_world +","+temp_stage_conut);
							Update_this_icon(i,temp_current_world,temp_stage_conut);
							temp_stage_conut++;
							}
						}
					
					}
				}

			my_manage_menu_uGUI.stage_screen_target_button = stage_icons[0].gameObject;
			if (this.gameObject.activeSelf)
				my_manage_menu_uGUI.Mark_this_button(my_manage_menu_uGUI.stage_screen_target_button);
			}

	}
예제 #9
0
    public void Create_new_profile(int profile_slot, bool show_cancel_button)
    {
        //copy options settings
        game_master.music_on[profile_slot]     = game_master.music_on[my_game_master.current_profile_selected];
        game_master.music_volume[profile_slot] = game_master.music_volume[my_game_master.current_profile_selected];
        game_master.sfx_on[profile_slot]       = game_master.sfx_on[my_game_master.current_profile_selected];
        game_master.sfx_volume[profile_slot]   = game_master.sfx_volume[my_game_master.current_profile_selected];
        game_master.voice_on[profile_slot]     = game_master.voice_on[my_game_master.current_profile_selected];
        game_master.voice_volume[profile_slot] = game_master.voice_volume[my_game_master.current_profile_selected];
        my_game_master.Save(profile_slot);

        //my_game_master.current_profile_selected = profile_slot;
        Show_current_slot_selected();

        if (my_game_master.require_a_name_for_profiles)
        {
            if (my_game_master.use_pad)
            {
                my_manage_menu_uGUI.current_screen.gameObject.SetActive(false);
                my_manage_menu_uGUI.my_new_profile_pad.My_start(profile_slot, show_cancel_button, profiles_array[profile_slot].gameObject);

                my_manage_menu_uGUI.Mark_this_button(my_manage_menu_uGUI.new_profile_window_pad_target_button);
            }
            else
            {
                my_manage_menu_uGUI.my_new_profile_window.GetComponent <new_profile_window>().My_start(profile_slot, show_cancel_button);
                //my_manage_menu_uGUI.my_new_profile_window.SetActive(true);
                //my_manage_menu_uGUI.my_new_profile_window.GetComponent<new_profile_window>().Focus();
            }
        }
        else
        {
            my_game_master.Create_new_profile("");
            Update_this_slot(profile_slot);
        }
    }
예제 #10
0
    public void My_start()
    {
        if (stage_icons.Length > 0)
        {
            if (game_master.game_master_obj)
            {
                my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master");
            }

            my_manage_menu_uGUI = GameObject.Find("Home_Canvas").GetComponent <manage_menu_uGUI>();

            if (my_game_master.press_start_and_go_to_selected == game_master.press_start_and_go_to.map)            //if the map is in use
            {
                if (my_game_master.total_number_of_stages_in_the_game != stage_icons.Length)
                {
                    Debug.LogError("the number of icons don't match the total number of stages in the game");
                }
                else
                {
                    int temp_current_world = 0;
                    int temp_stage_conut   = 1;
                    for (int i = 0; i < stage_icons.Length; i++)
                    {
                        //check if this stage icon belong to this world of if you must pass to next world
                        if (temp_stage_conut <= my_game_master.total_stages_in_world_n[temp_current_world])
                        {
                            //Debug.Log("same world " + temp_current_world +","+temp_stage_conut);
                            Update_this_icon(i, temp_current_world, temp_stage_conut);
                            temp_stage_conut++;
                        }
                        else                        //next world
                        {
                            temp_current_world++;
                            temp_stage_conut = 1;
                            //Debug.Log("new world " + temp_current_world +","+temp_stage_conut);
                            Update_this_icon(i, temp_current_world, temp_stage_conut);
                            temp_stage_conut++;
                        }
                    }
                }
            }
            my_manage_menu_uGUI.stage_screen_target_button = stage_icons[0].gameObject;
            if (this.gameObject.activeSelf)
            {
                my_manage_menu_uGUI.Mark_this_button(my_manage_menu_uGUI.stage_screen_target_button);
            }
        }
    }