Example #1
0
    //for button control
    public void OnButtonClick(string ButtonName)
    {
        switch (ButtonName)
        {
        //for magnet buying
        case "Magnet":
            print("Clicked on buy item1");
            IncreaseMagnetPower();                                     //for magnet purchase
            SoundController.Static.PlayClickSound();                   //for click sound
            break;

        //for mutliplier buying
        case "BuyMultiplier":
            print("Clicked on buy item2");
            IncreaseMultipiler();                                     //for multiplier purchase
            SoundController.Static.PlayClickSound();                  //for click sound
            break;

//for shield buying
        case "BuyShield":
            print("Clicked on buy item2");
            IncreaseShield();                                     //for shield purchase
            SoundController.Static.PlayClickSound();              //for click sound
            break;

        //for back to the main menu
        case "Back":
            StoreMenuParent.SetActive(false);
            mainMenuParent.SetActive(true);
            SoundController.Static.PlayClickSound();                                     //for click sound
            break;
        }
    }
Example #2
0
 //for disable all menu screens
 void DeActive()
 {
     MainMenuParent.SetActive(false);
     LoadingMenuParent.SetActive(false);
     PlayerSelectionParent.SetActive(false);
     ControlselectionMenuParent.SetActive(false);
     CredtsMenuParent.SetActive(false);
     ByPopupMenuParent.SetActive(false);
     UnSufficentCoinsMenuParent.SetActive(false);
     LevelSelectionMenuParent.SetActive(false);
     StoreMenuParent.SetActive(false);
     InnAppMenuParent.SetActive(false);
     UnsufficentCoinsForPlayerselectionMenu.SetActive(false);
 }
Example #3
0
    public void OnButtonClick(string ButtonName)
    {
        switch (ButtonName)
        {
        case "BuyMagnet":
            //print ("Clicked on buy item1");
            IncraseMagnetPower();
            SoundController.Static.playSoundFromName("Click");
            break;

        case "BuyMultiplier":
            print("Clicked on buy item2");
            IncraseMultipiler();
            SoundController.Static.playSoundFromName("Click");
            break;

        case "BuyFlyPower":
            print("Clicked on buy item3");
            IncreaseFlyPower();
            SoundController.Static.playSoundFromName("Click");
            break;

        case "BuyJumpPower":
            print("Clicked on buy item3");
            IncreaseJumpPower();
            SoundController.Static.playSoundFromName("Click");
            break;

        case "BuyShieldPower":
            print("Clicked on buy item4");
            IncreaseShieldPower();
            SoundController.Static.playSoundFromName("Click");
            break;

        case "Back":
            StoreMenuParent.SetActive(false);
            mainMenuParent.SetActive(true);
            MainMenu.currentScreen = MainMenu.MenuScreens.mainmenu;
            SoundController.Static.playSoundFromName("Click");
            break;
        }
    }
Example #4
0
 //for magnet purchase
 void IncreaseMagnetPower()
 {
     //for magnet purchase
     if (TotalCoins.Static.totalCoins >= PlayerPrefs.GetInt("MagnetCost", 500) && PlayerPrefs.GetInt("MagnetPower", 0) <= 3)
     {
         TotalCoins.Static.SubtractCoins(PlayerPrefs.GetInt("MagnetCost", 500));                                      //for subtraction coins in to magnet cost
         PlayerPrefs.SetInt("MagnetCost", PlayerPrefs.GetInt("MagnetCost", 500) + 500);                               //for magnet cost increase
         //for show magnet fill bar
         for (int i = 0; i < MagnetIndicators.Length; i++)
         {
             Debug.Log("Magnet Power1 " + PlayerPrefs.GetInt("MagnetPower", 0));
             if (i == PlayerPrefs.GetInt("MagnetPower", 0))
             {
                 MagnetIndicators [i].SetActive(true);
             }
         }
         //for ingame magnet value
         PlayerPrefs.SetInt("IngameMagnetCount", PlayerPrefs.GetInt("IngamemagnetCount", 0) + 6);
         PlayerPrefs.SetInt("MagnetPower", PlayerPrefs.GetInt("MagnetPower") + 1);
     }
     //for full text showing
     else
     {
         if (PlayerPrefs.GetInt("MagnetPower", 0) > 3)
         {
             MagnetFull.text = "Full";
         }
         //for unsufficent menu showing
         else
         {
             //gameObject.SetActive(false);
             unSufficentCoinsParent.SetActive(true);
             StoreMenuParent.SetActive(false);
             //	MainMenuScreens.currentScreen=MainMenuScreens.MenuScreens.StoreMenu;
         }
     }
 }