Beispiel #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Player"))        //if the player collide with this star
        {
            my_game_uGUI.Update_virtual_money(my_value);

            this.gameObject.SetActive(false);
        }
    }
Beispiel #2
0
 public void Pay_instead_of_watch()
 {
     if (my_game_master.my_ads_master.buy_button_cost <= my_game_master.current_virtual_money[my_game_master.current_profile_selected])
     {
         //you have enough money
         my_game_master.Gui_sfx(my_game_master.tap_sfx);
         //pay
         my_game_uGUI.Update_virtual_money(-my_game_master.my_ads_master.buy_button_cost);
         //gain
         my_game_master.my_ads_master.Give_reward();
         //close gift window
         gift_screen.SetActive(false);
         my_game_master.a_window_is_open = false;
         Time.timeScale = currentTimeScale;
         if (my_game_master.use_pad)
         {
             EventSystem_obj.SetActive(true);
         }
     }
     else        //you can't effort this purchase
     {
         my_game_master.Gui_sfx(my_game_master.tap_error_sfx);
     }
 }