示例#1
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);
            }
        }
    }
    public void Ok_button()
    {
        if (my_input.text != "")
        {
            int old_profile = my_game_master.current_profile_selected;
            my_game_master.current_profile_selected = profile_slot;

            if (my_manage_menu_uGUI.current_screen == my_manage_menu_uGUI.profile_screen)            //update profile screen
            {
                my_profile_manager.Select_this_profile(old_profile);
                my_profile_manager.Select_this_profile(profile_slot);
            }

            my_game_master.Gui_sfx(my_game_master.tap_sfx);
            my_game_master.Create_new_profile(my_input.text);
            my_input.text = "";
            my_manage_menu_uGUI.Update_profile_name(true);
            this.gameObject.SetActive(false);
            my_profile_manager.Update_this_slot(my_game_master.current_profile_selected);
        }
        else
        {
            my_game_master.Gui_sfx(my_game_master.tap_error_sfx);
        }
    }
示例#3
0
    public void Pause()
    {
        if (my_game_master)
        {
            my_game_master.Gui_sfx(my_game_master.tap_sfx);
        }

        if (in_pause)
        {
            in_pause         = false;
            allow_game_input = true;
            play_screen.gameObject.SetActive(true);
            Time.timeScale = 1;
            pause_screen.gameObject.SetActive(false);
            Mark_this_button(null);
        }
        else
        {
            in_pause         = true;
            allow_game_input = false;
            play_screen.gameObject.SetActive(false);
            pause_screen.gameObject.SetActive(true);
            Time.timeScale = 0;

            Mark_this_button(pause_screen_target_button);
        }
    }
 public void Ok_button()
 {
     if (my_input.text != "")
     {
         Debug.Log("SIGNING UP USER");
         CreateAccount();
         Debug.Log("SIGNED UP USER");
         setGUI();
     }
     else
     {
         my_game_master.Gui_sfx(my_game_master.tap_error_sfx);
     }
 }
示例#5
0
    public void Music_on_off()
    {
        if (game_master.music_on[my_game_master.current_profile_selected])
        {
            my_game_master.Music_on_off(false);
        }
        else
        {
            my_game_master.Music_on_off(true);
        }

        Update_sound_icons();
        my_game_master.Gui_sfx(my_game_master.tap_sfx);
    }
示例#6
0
    public void Show_profile_screen()
    {
        home_screen.gameObject.SetActive(false);
        my_game_master.Gui_sfx(my_game_master.tap_sfx);

        Mark_current_screen(profile_screen);

        if (my_game_master.this_profile_have_a_save_state_in_it[0])
        {
            Mark_this_button(profile_screen_target_button.transform.GetChild(0).gameObject);
        }
        else
        {
            Mark_this_button(profile_screen_target_button.transform.GetChild(1).gameObject);
        }
    }
示例#7
0
 public void Load_home()
 {
     my_game_master.Gui_sfx(my_game_master.tap_sfx);
     //my_game_master.Unlink_me_to_camera();
     my_game_master.go_to_this_screen = game_master.this_screen.home_screen;
     Application.LoadLevel(my_game_master.home_scene_name);
 }
示例#8
0
    public void Select_this_tab(int tab_id)
    {
        if (tab_selected != tab_id)
        {
            if (tab_selected >= 0)
            {
                my_game_master.Gui_sfx(my_game_master.tap_sfx);
            }

            for (int i = 0; i < tabs_length; i++)
            {
                windows[i].SetActive(false);
                tab_buttons_ico[i].sprite = not_selected_tab;
            }

            windows[tab_id].SetActive(true);
            tab_buttons_ico[tab_id].sprite = selected_tab;
            tab_selected = tab_id;

            if (!my_game_master)
            {
                my_game_master = (game_master)game_master.game_master_obj.GetComponent("game_master");
            }

            if (my_game_master.use_pad)
            {
                Invoke("Focus_on_first_button_of_this_window", 0.1f);
            }
        }
    }
示例#9
0
 public void Load_home()
 {
     my_game_master.Gui_sfx(my_game_master.tap_sfx);
     //my_game_master.Unlink_me_to_camera();
     my_game_master.go_to_this_screen = game_master.this_screen.home_screen;
     SceneManager.LoadScene(my_game_master.home_scene_name);
 }
示例#10
0
    public void UnlockAchievement(int id)
    {
        if (id >= achievements.Length)
        {
            Debug.LogWarning("Wrong Archievement id");
            return;
        }

        if (achievements[id].unlocked)//you have already unlock this;
        {
            return;
        }

        my_game_master.Gui_sfx(unlockSfx);

        achievements[id].unlocked = true;
        PlayerPrefs.SetInt("profile_" + my_game_master.current_profile_selected.ToString() + "_Achievements_" + id, Convert.ToInt32(achievements[id].unlocked));

        //reward
        my_game_master.stars_total_score[my_game_master.current_profile_selected] += achievements[id].starRevard;
        PlayerPrefs.SetInt("profile_" + my_game_master.current_profile_selected.ToString() + "_total_stars", my_game_master.stars_total_score[my_game_master.current_profile_selected]);
        my_game_master.current_virtual_money[my_game_master.current_profile_selected] += achievements[id].virtualMoneyReward;
        PlayerPrefs.SetInt("profile_" + my_game_master.current_profile_selected.ToString() + "_virtual_money", my_game_master.current_virtual_money[my_game_master.current_profile_selected]);


        PlayMe(achievements[id].icon, achievements[id].name);
    }
示例#11
0
/*
 *      IEnumerator Wait(float seconds)
 *      {
 *              Debug.Log(stage_number + " - start wait");
 *              yield return new WaitForSeconds(seconds);
 *              Debug.Log(stage_number + " - end wait");
 *      }*/

    IEnumerator Star_animation(bool start_1, bool start_2, bool start_3)
    {
        //Debug.Log(stage_number + " - Star_animation: "+start_1+","+start_2+","+start_3 + " *** " + Time.timeScale);
        my_manage_menu_uGUI.stage_ico_update_animation_is_running = true;
        yield return(new WaitForSeconds(0.5f));

        if (start_1)
        {
            star_on[0].SetActive(true);
            star_on[0].GetComponent <Animation>().Play();
            my_game_master.Gui_sfx(my_manage_menu_uGUI.show_mini_star[0]);

            if (start_2)
            {
                StartCoroutine(Star_animation(false, start_2, start_3));
            }
            else             //end animation
            {
                Check_tail_in_next_icon();
            }
        }
        else if (start_2)
        {
            star_on[1].SetActive(true);
            star_on[1].GetComponent <Animation>().Play();
            my_game_master.Gui_sfx(my_manage_menu_uGUI.show_mini_star[1]);
            if (start_3)
            {
                StartCoroutine(Star_animation(false, false, start_3));
            }
            else             //end animation
            {
                Check_tail_in_next_icon();
            }
        }
        else if (start_3)
        {
            star_on[2].SetActive(start_3);
            star_on[2].GetComponent <Animation>().Play();
            my_game_master.Gui_sfx(my_manage_menu_uGUI.show_mini_star[2]);
            //end animation
            Check_tail_in_next_icon();
        }
    }
示例#12
0
 public void Click_me()
 {
     if (you_have_enough_money && !this_buy_hit_the_cap)
     {
         my_game_master.Gui_sfx(my_game_master.tap_sfx);
         if (price_currency_selected == price_currency.real_money)
         {
             Pay_with_real_money();
         }
         else if (price_currency_selected == price_currency.virtual_money)
         {
             Pay_with_virtual_money();
         }
     }
     else
     {
         my_game_master.Gui_sfx(my_game_master.tap_error_sfx);
     }
 }
示例#13
0
    public void Watch_ad()
    {
        my_game_master.Gui_sfx(my_game_master.tap_sfx);

        //close window
        this.gameObject.SetActive(false);
        my_game_master.a_window_is_open = false;
        Time.timeScale = initial_time_scale;

        //star ad
        my_game_master.my_ads_master.Show_ad(true);        //true = rewarded
    }
示例#14
0
    public void Close_me()
    {
        //end pause
        Time.timeScale = currentTimeScale;

        if (my_game_master.use_pad)
        {
            EventSystem_obj.SetActive(true);            //in order to avoid pad input out the of the window
        }
        my_game_master.Gui_sfx(my_game_master.tap_sfx);
        my_game_master.a_window_is_open = false;
        this.gameObject.SetActive(false);
    }
示例#15
0
 public void Add_to_string(string add_this)
 {
     if (target_text.text.Length <= character_limit)
     {
         my_game_master.Gui_sfx(my_game_master.tap_sfx);
         my_name         += add_this;
         target_text.text = my_name;
     }
     else
     {
         my_game_master.Gui_sfx(my_game_master.tap_error_sfx);
     }
 }
示例#16
0
    void Star_sfx()
    {
        if (invoke_count < total_collectable_stars_in_this_stage)
        {
            stars_on[invoke_count].GetComponent <Animation>().Play("star");
            if (my_game_master)
            {
                int sfx_count = invoke_count;
                if (invoke_count > my_game_master.show_big_star_sfx.Length - 1)
                {
                    sfx_count = my_game_master.show_big_star_sfx.Length - 1;
                }


                my_game_master.Gui_sfx(my_game_master.show_big_star_sfx[sfx_count]);
            }

            invoke_count++;
        }
    }
示例#17
0
    public void Select_this_button(int button_id)
    {
        if (selected_button >= 0 && selected_button != button_id)
        {
            my_game_master.Gui_sfx(my_game_master.tap_sfx);
        }

        for (int i = 0; i < child_buttons; i++)
        {
            if (i == button_id)
            {
                selected_button = i;
                this.transform.GetChild(i).GetComponent <Image>().sprite = select_button_sprite;

                gift_button child_script = this.transform.GetChild(i).GetComponent <gift_button>();
                my_game_master.my_ads_master.current_quantity_reward_selected = child_script.quantity;
                my_game_master.my_ads_master.current_item_id_reward_selected  = child_script.item_id;
                my_game_master.my_ads_master.current_reward_selected          = child_script.give_this_selected;

                //update item description
                switch (my_game_master.my_ads_master.current_reward_selected)
                {
                case ads_master.ad_reward.virtual_money:
                    window_text_item_name.text        = my_game_master.virtual_money_name;
                    window_text_item_description.text = "";                            //my_game_master.current_quantity_reward_selected.ToString("N0");

                    break;

                case ads_master.ad_reward.new_live:
                    window_text_item_name.text        = my_game_master.lives_name;
                    window_text_item_description.text = "";                            // my_game_master.current_quantity_reward_selected.ToString("N0");
                    break;

                case ads_master.ad_reward.consumable_item:
                    window_text_item_name.text        = my_game_master.my_store_item_manager.consumable_item_list[my_game_master.my_ads_master.current_item_id_reward_selected].name;
                    window_text_item_description.text = my_game_master.my_store_item_manager.consumable_item_list[my_game_master.my_ads_master.current_item_id_reward_selected].description;
                    break;
                }
            }
            else
            {
                this.transform.GetChild(i).GetComponent <Image>().sprite = not_select_button_sprite;
            }
        }
    }
示例#18
0
 public void Ask_confirmation_to_delete_this_profile()
 {
     my_game_master.Gui_sfx(my_game_master.tap_sfx);
     ask_confirmation_window_prefab.SetActive(true);
     my_manage_menu_uGUI.Mark_this_button(ask_confirmation_target_button);
 }
示例#19
0
 public void Click_on()
 {
     my_game_master.Gui_sfx(my_game_master.tap_sfx);
     my_profile_manager.Select_this_profile(profile_number);
 }
示例#20
0
 public void Next()
 {
     my_game_master.Gui_sfx(my_game_master.tap_sfx);
     my_game_master.current_world[my_game_master.current_profile_selected]++;
     Update_page();
 }