Exemplo n.º 1
0
    public void HandCuffs()
    {
        if (MenuManager.totalscore >= handcuffValue)
        {
            if (!PlayerPrefs.HasKey("HandCuffTut"))
            {
                PlayerPrefs.SetInt("HandCuffTut", 1);
            }
//			golds-=goldToUpgradeLevel[upgradeValue];
            MenuManager.totalscore -= handcuffValue;
            PlayerPrefs.SetString("TotalScore", EncryptionHandler64.Encrypt(MenuManager.totalscore.ToString()));
//			PlayerPrefs.SetString("Golds",EncryptionHandler64.Encrypt (MenuManager.golds.ToString ()));
            MenuManager.handcuffNo++;
            PlayerPrefs.SetString("Handcuff", EncryptionHandler64.Encrypt(MenuManager.handcuffNo.ToString()));

            CallDecrementCoin();
        }
        else
        {
            MenuManager._instance.lastPanel     = gameObject;
            MenuManager._instance.lastPanelName = "SpecialPanel";
            MenuManager._instance.Insufficinetcoin();
            //Debug.Log("insufficient coins");
        }
    }
Exemplo n.º 2
0
    void PurchaseLevel(string toSetPlayerPref)
    {
        MenuManager.golds -= 20;
        PlayerPrefs.SetString("Golds", EncryptionHandler64.Encrypt(MenuManager.golds.ToString()));
        totalGoldText.text = MenuManager.golds.ToString();

        PlayerPrefs.SetInt(toSetPlayerPref, 1);
        if (PlayerPrefs.HasKey("ChinaOpen"))
        {
            China_lock.SetActive(false);
        }

        if (PlayerPrefs.HasKey("ItalyOpen"))
        {
            Italy_lock.SetActive(false);
        }
        if (PlayerPrefs.HasKey("AusOpen"))
        {
            Aus_lock.SetActive(false);
        }
        MenuManager._instance.EnableFadePanel();
        MenuManager._instance.popupPanel.gameObject.SetActive(false);
        //MenuPopup();
        //MenuManager._instance.popupPanel.EnablePopup ("Successfully unlocked the environment!",false);
    }
Exemplo n.º 3
0
    void OnMouseDown()
    {
        if (MenuManager.handcuffNo > 0)
        {
            MenuManager.handcuffNo--;
            UIManager._instance.n_Thieves_caught++;
            PlayerPrefs.SetInt("ThiefCaught", UIManager._instance.n_Thieves_caught);

            if (PlayerPrefs.GetInt("ThiefCaught") > 9 && PlayerPrefs.GetInt("ThiefLevel1") == 0)
            {
                PlayerPrefs.SetInt("ThiefLevel1", 1);
                UIManager._instance.achievment_text.SetActive(true);
                AchievementChild.check_claim++;
                PlayerPrefs.SetInt("claimvalue", AchievementChild.check_claim);
                Invoke("Stopa", 4.0f);
//				MenuManager.totalscore+=100;
//				PlayerPrefs.SetString("TotalScore",EncryptionHandler64.Encrypt (MenuManager.totalscore.ToString ()));
            }
            if (PlayerPrefs.GetInt("ThiefCaught") > 99 && PlayerPrefs.GetInt("ThiefLevel2") == 0)
            {
                PlayerPrefs.SetInt("ThiefLevel2", 1);
                UIManager._instance.achievment_text.SetActive(true);
                AchievementChild.check_claim++;
                PlayerPrefs.SetInt("claimvalue", AchievementChild.check_claim);
                Invoke("Stopa", 4.0f);
//				MenuManager.golds++;
//				PlayerPrefs.SetString("Golds",EncryptionHandler64.Encrypt (MenuManager.golds.ToString ()));
//				UIManager._instance.goldText.text = MenuManager.golds.ToString ();
            }
            if (PlayerPrefs.GetInt("ThiefCaught") > 999 && PlayerPrefs.GetInt("ThiefLevel3") == 0)
            {
                PlayerPrefs.SetInt("ThiefLevel3", 1);
                UIManager._instance.achievment_text.SetActive(true);
                AchievementChild.check_claim++;
                PlayerPrefs.SetInt("claimvalue", AchievementChild.check_claim);
                Invoke("Stopa", 4.0f);
//				MenuManager.golds += 5;
//				PlayerPrefs.SetString("Golds",EncryptionHandler64.Encrypt (MenuManager.golds.ToString ()));
//				UIManager._instance.goldText.text = MenuManager.golds.ToString ();
            }

            transform.position = CustomerHandler._instance.customerEndPosition.position;
            speed    = 35;
            isCaught = true;
            UIManager._instance.totalCoins += coinsStolen;
            UIManager._instance.CallIncrementCoint();
            UIManager._instance.coincollect.Play();

            PlayerPrefs.SetString("Handcuff", EncryptionHandler64.Encrypt(MenuManager.handcuffNo.ToString()));
            if (MenuManager.handcuffNo <= 0)
            {
                US_Manager._instance.handcuff.SetActive(false);
            }
        }
    }
Exemplo n.º 4
0
 public void BuyWhistle()
 {
     if (MenuManager.golds >= 20)
     {
         MenuManager.golds -= 20;
         PlayerPrefs.SetString("Golds", EncryptionHandler64.Encrypt(MenuManager.golds.ToString()));
         PlayerPrefs.SetInt("Whistle", 1);
         Application.LoadLevel(Application.loadedLevel);
     }
     else
     {
         UIManager._instance.EarnGold();
     }
 }
Exemplo n.º 5
0
 public void Buyhandcuff()
 {
     if (MenuManager.totalscore >= 1000)
     {
         MenuManager.totalscore -= 1000;
         PlayerPrefs.SetString("TotalScore", EncryptionHandler64.Encrypt(MenuManager.totalscore.ToString()));
         MenuManager.handcuffNo++;
         PlayerPrefs.SetString("Handcuff", EncryptionHandler64.Encrypt(MenuManager.handcuffNo.ToString()));
         Application.LoadLevel(Application.loadedLevel);
     }
     else
     {
         UIManager._instance.EarnCoin();
     }
     gameObject.SetActive(false);
 }
Exemplo n.º 6
0
 public void BuyRadio()
 {
     if (MenuManager.golds >= 20)
     {
         MenuManager.golds -= 20;
         UIManager._instance.goldText.text = MenuManager.golds.ToString();
         PlayerPrefs.SetString("Golds", EncryptionHandler64.Encrypt(MenuManager.golds.ToString()));
         PlayerPrefs.SetInt("Radio", 1);
         //Application.LoadLevel (Application.loadedLevel);
     }
     else
     {
         UIManager._instance.EarnGold();
     }
     gameObject.SetActive(false);
 }
Exemplo n.º 7
0
 public void ClaimHotdogAchievement1()
 {
     if (PlayerPrefs.GetInt("hotdogLevel1") == 1 && !PlayerPrefs.HasKey("hotdod1Claimed"))
     {
         // Show Tick
         // Effect
         PlayerPrefs.SetInt("hotdod1Claimed", 1);
         MenuManager.totalscore += 100;
         PlayerPrefs.SetString("TotalScore", EncryptionHandler64.Encrypt(MenuManager.totalscore.ToString()));
         //Display score
         CallIncrementCoin();
         myChild[24].myTick.SetActive(true);
         myChild[24].myClaimButton.SetActive(false);
         AchievementChild.check_claim--;
         PlayerPrefs.SetInt("claimvalue", AchievementChild.check_claim);
     }
 }
Exemplo n.º 8
0
 public void ClaimCustomerAchievement2()
 {
     if (PlayerPrefs.GetInt("CustomerLevel2") == 1 && !PlayerPrefs.HasKey("Customer2Claimed"))
     {
         MenuManager.golds++;
         PlayerPrefs.SetString("Golds", EncryptionHandler64.Encrypt(MenuManager.golds.ToString()));
         PlayerPrefs.SetInt("Customer2Claimed", 1);
         //			UIManager._instance.goldText.text = MenuManager.golds.ToString ();
         // Display incremented gold
         // Effect
         CallIncrementgold();
         myChild[1].myTick.SetActive(true);
         myChild[1].myClaimButton.SetActive(false);
         AchievementChild.check_claim--;
         PlayerPrefs.SetInt("claimvalue", AchievementChild.check_claim);
     }
 }
Exemplo n.º 9
0
    public void BuyCupcake()
    {
        if (MenuManager.totalscore >= 250)
        {
            MenuManager.totalscore -= 250;
            PlayerPrefs.SetString("TotalScore", EncryptionHandler64.Encrypt(MenuManager.totalscore.ToString()));

            MenuManager.cupcakeNo = 3;
            PlayerPrefs.SetString("Cupcake", EncryptionHandler64.Encrypt(MenuManager.cupcakeNo.ToString()));
            //Application.LoadLevel (Application.loadedLevel);
        }
        else
        {
            UIManager._instance.EarnCoin();
        }
        gameObject.SetActive(false);
    }
Exemplo n.º 10
0
 public void GetmoreCoins()
 {
     if (Advertisement.isReady())
     {
         Advertisement.Show(null, new ShowOptions {
             pause          = true,
             resultCallback = result => {
                 Debug.Log("video result = " + result.ToString());
                 if (result.ToString().Contains("Finished"))
                 {
                     MenuManager.totalscore += 10;
                     PlayerPrefs.SetString("TotalScore", EncryptionHandler64.Encrypt(MenuManager.totalscore.ToString()));
                 }
             }
         });
     }
 }
Exemplo n.º 11
0
 public void ClaimFrieseAchievement3()
 {
     if (PlayerPrefs.GetInt("FrenchfriesLevel3") == 1 && !PlayerPrefs.HasKey("Fries3Claimed"))
     {
         MenuManager.golds += 5;
         PlayerPrefs.SetString("Golds", EncryptionHandler64.Encrypt(MenuManager.golds.ToString()));
         PlayerPrefs.SetInt("Fries3Claimed", 1);
         //			UIManager._instance.goldText.text = MenuManager.golds.ToString ();
         // Display incremented gold
         // Effect
         // Show Tick
         CallIncrementgold();
         myChild[11].myTick.SetActive(true);
         myChild[11].myClaimButton.SetActive(false);
         AchievementChild.check_claim--;
         PlayerPrefs.SetInt("claimvalue", AchievementChild.check_claim);
     }
 }
Exemplo n.º 12
0
 public void ClaimCustomerAchievement1()
 {
     if (PlayerPrefs.GetInt("CustomerLevel1") == 1 && !PlayerPrefs.HasKey("Customer1Claimed"))
     {
         MenuManager.totalscore += 100;
         PlayerPrefs.SetString("TotalScore", EncryptionHandler64.Encrypt(MenuManager.totalscore.ToString()));
         PlayerPrefs.SetInt("Customer1Claimed", 1);
         //			UIManager._instance.goldText.text = MenuManager.golds.ToString ();
         CallIncrementCoin();
         // Display incremented gol
         // Effect
         // Show Tick
         myChild[0].myTick.SetActive(true);
         myChild[0].myClaimButton.SetActive(false);
         AchievementChild.check_claim--;
         PlayerPrefs.SetInt("claimvalue", AchievementChild.check_claim);
     }
 }
Exemplo n.º 13
0
    IEnumerator EarningsSlider()
    {
        float a = 1.5f;
        float finalSliderValue = (totalCoins * 1f) / (LevelManager._instance.targetScore[LevelManager.levelNo] * (a));

        if (finalSliderValue > 1)
        {
            finalSliderValue = 1;
        }
        while (sliderValue.value < finalSliderValue)
        {
            sliderValue.value += 0.02f;
            yield return(0);
        }
        sliderValue.value = finalSliderValue;

        int expertValue = (int)(LevelManager._instance.targetScore[LevelManager.levelNo] * (a));
        //Debug.Log ("expertValue = "+expertValue);
        int usStars = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString(MenuManager.envNo + "Stars"));

        if (totalCoins >= expertValue)
        {
            expertStar.gameObject.SetActive(true);
            expertStarAchieved.Play();
            if (!PlayerPrefs.HasKey(MenuManager.envNo + "Stars" + levelNoOfEnv))
            {
                PlayerPrefs.SetInt(MenuManager.envNo + "Stars" + levelNoOfEnv, 1);
                usStars++;
                PlayerPrefs.SetString(MenuManager.envNo + "Stars", EncryptionHandler64.Encrypt(usStars.ToString()));
            }
            expertStar.transform.localScale = Vector3.zero;
            expertStar.sprite = starSprite;
            StartCoroutine(ExpertStar());
            //	Debug.Log("usStars = "+usStars);

            int noOfStars = usStars;
            stars[noOfStars - 1].gameObject.SetActive(true);
        }
    }
Exemplo n.º 14
0
 public void Buyhandcuff()
 {
     if (MenuManager.totalscore >= 1000)
     {
         MenuManager.totalscore -= 1000;
         PlayerPrefs.SetString("TotalScore", EncryptionHandler64.Encrypt(MenuManager.totalscore.ToString()));
         MenuManager.handcuffNo++;
         PlayerPrefs.SetString("Handcuff", EncryptionHandler64.Encrypt(MenuManager.handcuffNo.ToString()));
         if (MenuManager.handcuffNo > 0)
         {
             US_Manager._instance.handcuff.SetActive(true);
         }
         else
         {
             US_Manager._instance.handcuff.SetActive(false);
         }
     }
     else
     {
         UIManager._instance.EarnCoin();
     }
     gameObject.SetActive(false);
 }
Exemplo n.º 15
0
    public void Cupcake()
    {
        if (MenuManager.totalscore >= cupcakeValue)
        {
            if (!PlayerPrefs.HasKey("cupcakeTut"))
            {
                PlayerPrefs.SetInt("cupcakeTut", 1);
            }
//			golds-=goldToUpgradeLevel[upgradeValue];
            MenuManager.totalscore -= cupcakeValue;
            PlayerPrefs.SetString("TotalScore", EncryptionHandler64.Encrypt(MenuManager.totalscore.ToString()));
//			PlayerPrefs.SetString("Golds",EncryptionHandler64.Encrypt (MenuManager.golds.ToString ()));
            MenuManager.cupcakeNo = 3;
            PlayerPrefs.SetString("Cupcake", EncryptionHandler64.Encrypt(MenuManager.cupcakeNo.ToString()));

            CallDecrementCoin();
        }
        else
        {
            MenuManager._instance.Insufficinetcoin();
            //Debug.Log("insufficient coins");
        }
    }
Exemplo n.º 16
0
    public void BuyBell()
    {
        //Debug.Log ("Total gold " + MenuManager.golds);
        //Debug.Log ("Total gold " + UIManager._instance.goldText.text);

        if (MenuManager.golds >= 30)
        {
            MenuManager.golds -= 30;
            PlayerPrefs.SetString("Golds", EncryptionHandler64.Encrypt(MenuManager.golds.ToString()));
            UIManager._instance.goldText.text = MenuManager.golds.ToString();
            //				MenuManager.totalscore-=bellValue;
            //				PlayerPrefs.SetString("TotalScore",EncryptionHandler64.Encrypt (MenuManager.totalscore.ToString ()));
            PlayerPrefs.SetString("Golds", EncryptionHandler64.Encrypt(MenuManager.golds.ToString()));
            PlayerPrefs.SetInt("Bell", 1);
            US_Manager._instance.Bell.SetActive(true);
            CustomerHandler._instance.stop = false;
        }
        else
        {
            UIManager._instance.EarnGold();
        }
        gameObject.SetActive(false);
    }
Exemplo n.º 17
0
    public void Bell()
    {
        if (!PlayerPrefs.HasKey("Bell"))
        {
            if (MenuManager.golds >= bellValue)
            {
                if (!PlayerPrefs.HasKey("BellsTut"))
                {
                    PlayerPrefs.SetInt("BellsTut", 1);
                }

                MenuManager.golds -= bellValue;
//				MenuManager.totalscore-=bellValue;
//				PlayerPrefs.SetString("TotalScore",EncryptionHandler64.Encrypt (MenuManager.totalscore.ToString ()));
                PlayerPrefs.SetString("Golds", EncryptionHandler64.Encrypt(MenuManager.golds.ToString()));
                PlayerPrefs.SetInt("Bell", 1);
                //StartCoroutine(FacebookHandler._instance.SendSingleKey("Bell","1"));
                FacebookHandler._instance.send_single_key("Bell", "1");
                CallDecrementCoin();
                bell_tex.SetActive(false);
                bell_tick.SetActive(true);
                bell_gold.SetActive(false);
            }
            else
            {
                MenuManager._instance.lastPanel     = gameObject;
                MenuManager._instance.lastPanelName = "SpecialPanel";
                MenuManager._instance.Insufficinetgold();
                //Debug.Log("insufficient coins");
            }
        }
        else
        {
            MenuManager._instance.Bellpurchase();
            //Debug.Log("Already Purchased");
        }
    }
Exemplo n.º 18
0
    public void PurchaseItem()
    {
        if ((MenuManager.totalscore >= elementsCoinPrice[clickedItem]) && (MenuManager.golds >= elementsGoldPrice[clickedItem]))
        {
            MenuManager.golds      -= elementsGoldPrice[clickedItem];
            MenuManager.totalscore -= elementsCoinPrice[clickedItem];

            PlayerPrefs.SetString("TotalScore", EncryptionHandler64.Encrypt(MenuManager.totalscore.ToString()));
            PlayerPrefs.SetString("Golds", EncryptionHandler64.Encrypt(MenuManager.golds.ToString()));

            selectButton.SetActive(true);

            PlayerPrefs.SetString(myName, elementsName[clickedItem]);
            string a = elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1);
            Debug.Log("imp" + a);
            //Debug.LogError("name"+myName+"elemetsname"+elementsName[clickedItem]);
            //Debug.LogError("stroe"+PlayerPrefs.GetString("US_TableCover"));
            Debug.LogError("valueoff" + int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)));
            PlayerPrefs.SetInt(elementsName[clickedItem], 1);


            if (myName == "US_TableCover")
            {
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 2)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("UsTableCover","1"));
                    FacebookHandler._instance.send_single_key("UsTableCover", "1");
                }
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 3)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("UsTableCover3","1"));
                    FacebookHandler._instance.send_single_key("UsTableCover3", "1");
                }
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 4)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("UsTableCover4","1"));
                    FacebookHandler._instance.send_single_key("UsTableCover4", "1");
                }
            }

            if (myName == "China_TableCover")
            {
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 2)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("ChinaTableCover","1"));
                    FacebookHandler._instance.send_single_key("ChinaTableCover", "1");
                }
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 3)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("ChinaTableCover3","1"));
                    FacebookHandler._instance.send_single_key("ChinaTableCover3", "1");
                }
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 4)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("ChinaTableCover4","1"));
                    FacebookHandler._instance.send_single_key("ChinaTableCover4", "1");
                }
            }

            if (myName == "China_TableTop")
            {
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 2)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("ChinaTableTop","1"));
                    FacebookHandler._instance.send_single_key("ChinaTableTop", "1");
                }
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 3)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("ChinaTableTop3","1"));
                    FacebookHandler._instance.send_single_key("ChinaTableTop3", "1");
                }
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 4)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("ChinaTableTop4","1"));
                    FacebookHandler._instance.send_single_key("ChinaTableTop4", "1");
                }
            }

            if (myName == "Italy_TableCover")
            {
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 2)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("ItalyTableCover","1"));
                    FacebookHandler._instance.send_single_key("ItalyTableCover", "1");
                }
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 3)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("ItalyTableCover3","1"));
                    FacebookHandler._instance.send_single_key("ItalyTableCover3", "1");
                }
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 4)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("ItalyTableCover4","1"));
                    FacebookHandler._instance.send_single_key("ItalyTableCover4", "1");
                }
            }

            if (myName == "Italy_TableTop")
            {
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 2)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("ItalyTableTop","1"));
                    FacebookHandler._instance.send_single_key("ItalyTableTop", "1");
                }
            }

            if (myName == "Aus_TableCover")
            {
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 2)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("AusTableColor","1"));
                    FacebookHandler._instance.send_single_key("AusTableColor", "1");
                }
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 3)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("AusTableColor3","1"));
                    FacebookHandler._instance.send_single_key("AusTableColor3", "1");
                }
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 4)
                {
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("AusTableColor4","1"));
                    FacebookHandler._instance.send_single_key("AusTableColor4", "1");
                }
            }

            if (myName == "Aus_TableTop")
            {
                if (int.Parse(elementsName[clickedItem].Substring(elementsName[clickedItem].Length - 1)) == 2)
                {
                    FacebookHandler._instance.send_single_key("AusTableTop", "1");
                    //StartCoroutine(FacebookHandler._instance.SendSingleKey("AusTableTop","1"));
                }
            }

            PlayerPrefs.SetInt(elementsName[clickedItem], 1);
            Debug.Log("done this " + PlayerPrefs.GetInt(elementsName[clickedItem]));


            selectedButtonText.text = "SELECTED";
            DecorationPanel._instance.CallDecrementCoin();
            priceButton.SetActive(false);
        }
        else
        {
            if ((MenuManager.totalscore < elementsCoinPrice[clickedItem]))
            {
                MenuManager._instance.lastPanel     = myParent;
                MenuManager._instance.lastPanelName = "DecorationPanel";
                MenuManager._instance.Insufficinetcoin();
            }
            else if ((MenuManager.golds < elementsGoldPrice[clickedItem]))
            {
                MenuManager._instance.lastPanel     = myParent;
                MenuManager._instance.lastPanelName = "DecorationPanel";
                MenuManager._instance.Insufficinetgold();
            }
            //Debug.Log("insufficient coins");
        }
    }
Exemplo n.º 19
0
    public void OnPurchase()
    {
//		int golds = (int)EncryptionHandler64.Decrypt (PlayerPrefs.GetString("Golds"));
//		int totalscore = (int)EncryptionHandler64.Decrypt (PlayerPrefs.GetString("TotalScore"));

        if (MenuManager.totalscore >= coinsToUpgradeLevel[upgradeValue] && MenuManager.golds >= goldToUpgradeLevel[upgradeValue])
        {
            MenuManager.golds      -= goldToUpgradeLevel[upgradeValue];
            MenuManager.totalscore -= coinsToUpgradeLevel[upgradeValue];
            upgradeNoImages[upgradeValue + 1].SetActive(true);
            PlayerPrefs.SetString("TotalScore", EncryptionHandler64.Encrypt(MenuManager.totalscore.ToString()));
            PlayerPrefs.SetString("Golds", EncryptionHandler64.Encrypt(MenuManager.golds.ToString()));
            upgradeValue++;
            PlayerPrefs.SetString(myName + "Upgrade", EncryptionHandler64.Encrypt(upgradeValue.ToString()));

            if (myName == "Grills")
            {
                //StartCoroutine(FacebookHandler._instance.SendSingleKey("GrilUpLevel",upgradeValue.ToString())) ;
                FacebookHandler._instance.send_single_key("GrilUpLevel", upgradeValue.ToString());
            }
            if (myName == "USCoke")
            {
                //StartCoroutine(FacebookHandler._instance.SendSingleKey("ColaTraysLevel",upgradeValue.ToString())) ;
                FacebookHandler._instance.send_single_key("ColaTraysLevel", upgradeValue.ToString());
            }
            if (myName == "Plate")
            {
                //StartCoroutine(FacebookHandler._instance.SendSingleKey("HotTraysLevel",upgradeValue.ToString())) ;
                FacebookHandler._instance.send_single_key("HotTraysLevel", upgradeValue.ToString());
            }
            if (myName == "ChinaBowls")
            {
                //StartCoroutine(FacebookHandler._instance.SendSingleKey("SoupBowlLevel",upgradeValue.ToString())) ;
                FacebookHandler._instance.send_single_key("SoupBowlLevel", upgradeValue.ToString());
            }
            if (myName == "ChinaPans")
            {
                //StartCoroutine(FacebookHandler._instance.SendSingleKey("SkilletLevel",upgradeValue.ToString())) ;
                FacebookHandler._instance.send_single_key("SkilletLevel", upgradeValue.ToString());
            }
            if (myName == "ChinaSoupContainer")
            {
                //StartCoroutine(FacebookHandler._instance.SendSingleKey("StockPotLevel",upgradeValue.ToString())) ;
                FacebookHandler._instance.send_single_key("StockPotLevel", upgradeValue.ToString());
            }
            if (myName == "ChinaPlate")
            {
                //StartCoroutine(FacebookHandler._instance.SendSingleKey("NoodleDishesLevel",upgradeValue.ToString())) ;
                FacebookHandler._instance.send_single_key("NoodleDishesLevel", upgradeValue.ToString());
            }
            if (myName == "ItalyCoke")
            {
                //StartCoroutine(FacebookHandler._instance.SendSingleKey("ColaTraysItalyLevel",upgradeValue.ToString())) ;
                FacebookHandler._instance.send_single_key("ColaTraysItalyLevel", upgradeValue.ToString());
            }
            if (myName == "ItalyPlate")
            {
                //StartCoroutine(FacebookHandler._instance.SendSingleKey("DishesLevel",upgradeValue.ToString())) ;
                FacebookHandler._instance.send_single_key("DishesLevel", upgradeValue.ToString());
            }
            if (myName == "Oven")
            {
                //StartCoroutine(FacebookHandler._instance.SendSingleKey("OvenLevel",upgradeValue.ToString())) ;
                FacebookHandler._instance.send_single_key("OvenLevel", upgradeValue.ToString());
            }

            if (myName == "AusPlate")
            {
                //StartCoroutine(FacebookHandler._instance.SendSingleKey("DishesAusLevel",upgradeValue.ToString())) ;
                FacebookHandler._instance.send_single_key("DishesAusLevel", upgradeValue.ToString());
            }

            if (myName == "AusCoke")
            {
                //StartCoroutine(FacebookHandler._instance.SendSingleKey("ColaTraysAusLevel",upgradeValue.ToString())) ;
                FacebookHandler._instance.send_single_key("ColaTraysAusLevel", upgradeValue.ToString());
            }

            if (myName == "Fries")
            {
                //StartCoroutine(FacebookHandler._instance.SendSingleKey("DeepFrierLevel",upgradeValue.ToString())) ;
                FacebookHandler._instance.send_single_key("DeepFrierLevel", upgradeValue.ToString());
            }

            if (myName == "AusGrills")
            {
                //StartCoroutine(FacebookHandler._instance.SendSingleKey("GrillUpAusLevel",upgradeValue.ToString())) ;
                FacebookHandler._instance.send_single_key("GrillUpAusLevel", upgradeValue.ToString());
            }


//			equipmentPanel.totalGoldText.text = golds.ToString ();
//			equipmentPanel.totalCoinsText.text = totalscore.ToString ();
            equipmentPanel.CallDecrementCoin();
            OnClickToShow();
            if (equ_number == 10)
            {
                PlayerPrefs.SetInt("Fridge", 1);

                //StartCoroutine(FacebookHandler._instance.SendSingleKey("FridgeLevel","1")) ;
                FacebookHandler._instance.send_single_key("FridgeLevel", "1");
                equipmentPanel.purchaseButton.SetActive(false);
            }
        }
        else
        {
            if ((MenuManager.totalscore < coinsToUpgradeLevel[upgradeValue]))
            {
                MenuManager._instance.lastPanel     = equipmentPanel.gameObject;
                MenuManager._instance.lastPanelName = "EquipmentUpdrade";
                MenuManager._instance.Insufficinetcoin();
            }
            else if ((MenuManager.golds < goldToUpgradeLevel[upgradeValue]))
            {
                MenuManager._instance.Insufficinetgold();
                MenuManager._instance.lastPanel     = equipmentPanel.gameObject;
                MenuManager._instance.lastPanelName = "EquipmentUpdrade";
            }
            //Debug.Log("insufficient funds");
        }
//		PlayerPrefs.GetInt ("Golds");
//		PlayerPrefs.SetInt ("TotalScore",PlayerPrefs.GetInt ("TotalScore"));
    }
Exemplo n.º 20
0
    // Use this for initialization
    void Start()
    {
//		Debug.LogError("Onee"+PlayerPrefs.GetInt("China/a-1"));
//		Debug.LogError("tree"+PlayerPrefs.GetInt("China/a-3"));
//		Debug.LogError("four"+PlayerPrefs.GetInt("China/a-4"));
//
//
//
//
//		Debug.Log("impp"+PlayerPrefs.GetString("GrillsUpgrade"));

        _instance = this;
                #if UNITY_IOS || UNITY_IPHONE
        Debug.Log("Chartboostcaching @Menumanager");
#elif UNITY_ANDROID
        GoogleMobileAdsDemoScript._instance.RequestInterstitial();
#endif
        Application.targetFrameRate  = 120;
        AchievementChild.check_claim = (PlayerPrefs.GetInt("claimvalue"));
        //PlayerPrefs.DeleteAll ();

        if (!PlayerPrefs.HasKey("PlateUpgrade"))
        {
            PlayerPrefs.SetString("Golds", EncryptionHandler64.Encrypt("1"));
            PlayerPrefs.SetString("TotalScore", EncryptionHandler64.Encrypt("100"));

            PlayerPrefs.SetString("Cupcake", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("Handcuff", EncryptionHandler64.Encrypt("0"));


            PlayerPrefs.SetString("GrillsUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("USCokeUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("PlateUpgrade", EncryptionHandler64.Encrypt("0"));


            PlayerPrefs.SetString("USStars", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("USLevels", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("US_TableCover", "US/base-flat-1");
            PlayerPrefs.SetString("US_TableTop", "US/top-floor-1");

            PlayerPrefs.SetInt("US/base-flat-1", 1);
            PlayerPrefs.SetInt("US/top-floor-1", 1);

            PlayerPrefs.SetString("AusLevels", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("ItalyLevels", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("ChinaLevels", EncryptionHandler64.Encrypt("0"));

            PlayerPrefs.SetString("ItalyStars", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("Italy_TableCover", "Italy/1");
            PlayerPrefs.SetString("Italy_TableTop", "Italy/top-strip-1");

            PlayerPrefs.SetString("ItalyPlateUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("ItalyCokeUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("OvenUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetInt("Italy/1", 1);
            PlayerPrefs.SetInt("Italy/top-strip-1", 1);


            PlayerPrefs.SetString("ChinaStars", EncryptionHandler64.Encrypt("0"));

            PlayerPrefs.SetString("China_TableCover", "China/1");
            PlayerPrefs.SetString("China_TableTop", "China/a-1");

            PlayerPrefs.SetString("ChinaPlateUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("ChinaBowlsUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("ChinaPansUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("ChinaSoupContainerUpgrade", EncryptionHandler64.Encrypt("0"));

            PlayerPrefs.SetInt("China/1", 1);
            PlayerPrefs.SetInt("China/a-1", 1);

            PlayerPrefs.SetString("AusStars", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("Aus_TableCover", "Aus/1");
            PlayerPrefs.SetString("Aus_TableTop", "Aus/top-shed-1");

            PlayerPrefs.SetString("AusPlateUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("FriesUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("AusCokeUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("AusGrillsUpgrade", EncryptionHandler64.Encrypt("0"));

            PlayerPrefs.SetInt("Aus/1", 1);
            PlayerPrefs.SetInt("Aus/top-shed-1", 3);
            PlayerPrefs.SetInt("Upgrade2", 1);
        }


//		PlayerPrefs.SetInt ("ItalyOpen", 1);
//		PlayerPrefs.SetInt ("ChinaOpen", 1);

        //	PlayerPrefs.SetString("Golds",EncryptionHandler64.Encrypt ("100"));
//			PlayerPrefs.SetString ("ChinaSoupContainerUpgrade",EncryptionHandler64.Encrypt ("0"));


        golds      = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("Golds"));
        totalscore = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("TotalScore"));
        cupcakeNo  = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("Cupcake"));
        handcuffNo = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("Handcuff"));
    }
Exemplo n.º 21
0
    IEnumerator SendLoginData()
    {
        Debug.Log("FB.IsLoggedIn  =  " + FB.IsLoggedIn);
        if (FB.IsLoggedIn && Application.internetReachability != NetworkReachability.NotReachable)
        {
            string  url   = baseUrl + "getDetail";
            WWWForm wForm = new WWWForm();
            Debug.Log("access token    == =    " + AccessToken.CurrentAccessToken.TokenString);
            wForm.AddField("access_token", AccessToken.CurrentAccessToken.TokenString);
            WWW wLogin = new WWW(url, wForm);
            yield return(wLogin);

            Debug.Log("aa" + wLogin.text);
            if (wLogin.error == null)
            {
                Debug.Log(wLogin.text);
                if (wLogin.text.Contains("status"))
                {
                    IDictionary responseDic = (IDictionary)Json.Deserialize(wLogin.text);
                    string      status      = responseDic ["status"].ToString();
                    string      message     = responseDic ["message"].ToString();
                    if (status == "success")
                    {
                        PlayerPrefs.SetInt("FBLogin", 1);
                        if (message.Contains("New user created."))
                        {
                            StartCoroutine(SendUpdatedData());


                            //Send Data
                        }
                        else
                        {
                            Debug.Log(message);

                            IDictionary dataDic = (IDictionary)responseDic ["message"];

                            Debug.Log(dataDic ["ColaTraysLevel"].ToString());

                            int a = int.Parse(dataDic ["ColaTraysLevel"].ToString());


                            Debug.Log("yes" + PlayerPrefs.GetString("HotTraysLevel").ToString());

                            int grilUpLevel = 0;
                            int.TryParse(dataDic ["GrilUpLevel"].ToString(), out grilUpLevel);

                            if (grilUpLevel > (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("GrillsUpgrade")))
                            {
                                PlayerPrefs.SetString("GrillsUpgrade", EncryptionHandler64.Encrypt(dataDic ["GrilUpLevel"].ToString()));
                            }
                            int colaTraysLevel = 0;
                            int.TryParse(dataDic ["ColaTraysLevel"].ToString(), out colaTraysLevel);
                            if (colaTraysLevel > (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("USCokeUpgrade")))
                            {
                                PlayerPrefs.SetString("USCokeUpgrade", EncryptionHandler64.Encrypt(dataDic ["ColaTraysLevel"].ToString()));
                            }

                            int hotTrayLevels = 0;
                            int.TryParse(dataDic ["HotTraysLevel"].ToString(), out hotTrayLevels);

                            if (hotTrayLevels > (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("PlateUpgrade")))
                            {
                                PlayerPrefs.SetString("PlateUpgrade", EncryptionHandler64.Encrypt(dataDic ["HotTraysLevel"].ToString()));
                            }

                            int soupBowlLevel = 0;
                            int.TryParse(dataDic ["SoupBowlLevel"].ToString(), out soupBowlLevel);

                            if (soupBowlLevel > (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ChinaBowlsUpgrade")))
                            {
                                PlayerPrefs.SetString("ChinaBowlsUpgrade", EncryptionHandler64.Encrypt(dataDic ["SoupBowlLevel"].ToString()));
                            }

                            int skilletLevel = 0;
                            int.TryParse(dataDic ["SkilletLevel"].ToString(), out skilletLevel);
                            if (skilletLevel > (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ChinaPansUpgrade")))
                            {
                                PlayerPrefs.SetString("ChinaPansUpgrade", EncryptionHandler64.Encrypt(dataDic ["SkilletLevel"].ToString()));
                            }
                            int stockPotLevel = 0;
                            int.TryParse(dataDic ["StockPotLevel"].ToString(), out stockPotLevel);
                            if (stockPotLevel > (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ChinaSoupContainerUpgrade")))
                            {
                                PlayerPrefs.SetString("ChinaSoupContainerUpgrade", EncryptionHandler64.Encrypt(dataDic ["StockPotLevel"].ToString()));
                            }
                            int noodleDishesLevel = 0;
                            int.TryParse(dataDic ["NoodleDishesLevel"].ToString(), out noodleDishesLevel);
                            if (noodleDishesLevel > (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ChinaPlateUpgrade")))
                            {
                                PlayerPrefs.SetString("ChinaPlateUpgrade", EncryptionHandler64.Encrypt(dataDic ["NoodleDishesLevel"].ToString()));
                            }
                            int colaTraysItalyLevel = 0;
                            int.TryParse(dataDic ["ColaTraysItalyLevel"].ToString(), out colaTraysItalyLevel);
                            if (colaTraysItalyLevel > (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ItalyCokeUpgrade")))
                            {
                                PlayerPrefs.SetString("ItalyCokeUpgrade", EncryptionHandler64.Encrypt(dataDic ["ColaTraysItalyLevel"].ToString()));
                            }
                            int dishesLevel = 0;
                            int.TryParse(dataDic ["DishesLevel"].ToString(), out dishesLevel);
                            if (dishesLevel > (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ItalyPlateUpgrade")))
                            {
                                PlayerPrefs.SetString("ItalyPlateUpgrade", EncryptionHandler64.Encrypt(dataDic ["DishesLevel"].ToString()));
                            }
                            int ovenLevel = 0;
                            int.TryParse(dataDic ["OvenLevel"].ToString(), out ovenLevel);
                            if (ovenLevel > (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("OvenUpgrade")))
                            {
                                PlayerPrefs.SetString("OvenUpgrade", EncryptionHandler64.Encrypt(dataDic ["OvenLevel"].ToString()));
                            }
                            int dishesAusLevel = 0;
                            int.TryParse(dataDic ["DishesAusLevel"].ToString(), out dishesAusLevel);
                            if (dishesAusLevel > (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("AusPlateUpgrade")))
                            {
                                PlayerPrefs.SetString("AusPlateUpgrade", EncryptionHandler64.Encrypt(dataDic ["DishesAusLevel"].ToString()));
                            }

                            int colaTraysAusLevel = 0;
                            int.TryParse(dataDic ["ColaTraysAusLevel"].ToString(), out colaTraysAusLevel);
                            if (colaTraysAusLevel > (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("AusCokeUpgrade")))
                            {
                                PlayerPrefs.SetString("AusCokeUpgrade", EncryptionHandler64.Encrypt(dataDic ["ColaTraysAusLevel"].ToString()));
                            }

                            int deepFrierLevel = 0;
                            int.TryParse(dataDic ["DeepFrierLevel"].ToString(), out deepFrierLevel);
                            if (deepFrierLevel > (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("FriesUpgrade")))
                            {
                                PlayerPrefs.SetString("FriesUpgrade", EncryptionHandler64.Encrypt(dataDic ["DeepFrierLevel"].ToString()));
                            }

                            int grillUpAusLevel = 0;
                            int.TryParse(dataDic ["GrillUpAusLevel"].ToString(), out grillUpAusLevel);

                            if (grillUpAusLevel > (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("AusGrillsUpgrade")))
                            {
                                PlayerPrefs.SetString("AusGrillsUpgrade", EncryptionHandler64.Encrypt(dataDic ["GrillUpAusLevel"].ToString()));
                            }

                            int fridgeLevel = 0;
                            int.TryParse(dataDic ["FridgeLevel"].ToString(), out fridgeLevel);
                            if (fridgeLevel > (PlayerPrefs.GetInt("Fridge")))
                            {
                                PlayerPrefs.SetInt("Fridge", int.Parse(dataDic ["FridgeLevel"].ToString()));
                            }

                            int usTableCover = 0;
                            int.TryParse(dataDic ["UsTableCover"].ToString(), out usTableCover);
                            if (usTableCover > (PlayerPrefs.GetInt("US/base-flat-2")))
                            {
                                PlayerPrefs.SetInt("US/base-flat-2", int.Parse(dataDic ["UsTableCover"].ToString()));
                            }

                            int usTableCover3 = 0;
                            int.TryParse(dataDic ["UsTableCover3"].ToString(), out usTableCover3);
                            if (usTableCover3 > (PlayerPrefs.GetInt("US/base-flat-3")))
                            {
                                PlayerPrefs.SetInt("US/base-flat-3", int.Parse(dataDic ["UsTableCover3"].ToString()));
                            }

                            int usTableCover4 = 0;
                            int.TryParse(dataDic ["UsTableCover4"].ToString(), out usTableCover4);
                            if (usTableCover4 > (PlayerPrefs.GetInt("US/base-flat-4")))
                            {
                                PlayerPrefs.SetInt("US/base-flat-4", int.Parse(dataDic ["UsTableCover4"].ToString()));
                            }

                            int chinaTableCover = 0;
                            int.TryParse(dataDic ["ChinaTableCover"].ToString(), out chinaTableCover);
                            if (chinaTableCover > (PlayerPrefs.GetInt("China/2")))
                            {
                                PlayerPrefs.SetInt("China/2", int.Parse(dataDic ["ChinaTableCover"].ToString()));
                            }

                            int chinaTableCover3 = 0;
                            int.TryParse(dataDic ["ChinaTableCover3"].ToString(), out chinaTableCover3);
                            if (chinaTableCover3 > (PlayerPrefs.GetInt("China/3")))
                            {
                                PlayerPrefs.SetInt("China/3", int.Parse(dataDic ["ChinaTableCover3"].ToString()));
                            }

                            int chinaTableCover4 = 0;
                            int.TryParse(dataDic ["ChinaTableCover4"].ToString(), out chinaTableCover4);
                            if (usTableCover4 > (PlayerPrefs.GetInt("China/4")))
                            {
                                PlayerPrefs.SetInt("China/4", int.Parse(dataDic ["ChinaTableCover4"].ToString()));
                            }

                            int chinaTableTop = 0;
                            int.TryParse(dataDic ["ChinaTableTop"].ToString(), out chinaTableTop);
                            if (chinaTableTop > (PlayerPrefs.GetInt("China/a-2")))
                            {
                                PlayerPrefs.SetInt("China/a-2", int.Parse(dataDic ["ChinaTableTop"].ToString()));
                            }

                            int chinaTableTop3 = 0;
                            int.TryParse(dataDic ["ChinaTableTop3"].ToString(), out chinaTableTop3);
                            if (chinaTableTop3 > (PlayerPrefs.GetInt("China/a-3")))
                            {
                                PlayerPrefs.SetInt("China/a-3", int.Parse(dataDic ["ChinaTableTop3"].ToString()));
                            }

                            int chinaTableTop4 = 0;
                            int.TryParse(dataDic ["ChinaTableTop4"].ToString(), out chinaTableTop4);
                            if (chinaTableTop4 > (PlayerPrefs.GetInt("China/a-4")))
                            {
                                PlayerPrefs.SetInt("China/a-4", int.Parse(dataDic ["ChinaTableTop4"].ToString()));
                            }

                            int italyTableTop = 0;
                            int.TryParse(dataDic ["ItalyTableTop"].ToString(), out italyTableTop);
                            if (italyTableTop > (PlayerPrefs.GetInt("Italy/top-strip-2")))
                            {
                                PlayerPrefs.SetInt("Italy/top-strip-2", int.Parse(dataDic ["ItalyTableTop"].ToString()));
                            }

                            int italyTableCover = 0;
                            int.TryParse(dataDic ["ItalyTableCover"].ToString(), out italyTableCover);
                            if (italyTableCover > (PlayerPrefs.GetInt("Italy/2")))
                            {
                                PlayerPrefs.SetInt("Italy/2", int.Parse(dataDic ["ItalyTableCover"].ToString()));
                            }

                            int italyTableCover3 = 0;
                            int.TryParse(dataDic ["ItalyTableCover3"].ToString(), out italyTableCover3);
                            if (italyTableCover3 > (PlayerPrefs.GetInt("Italy/3")))
                            {
                                PlayerPrefs.SetInt("Italy/3", int.Parse(dataDic ["ItalyTableCover3"].ToString()));
                            }

                            int italyTableCover4 = 0;
                            int.TryParse(dataDic ["ItalyTableCover3"].ToString(), out italyTableCover4);
                            if (italyTableCover4 > (PlayerPrefs.GetInt("Italy/4")))
                            {
                                PlayerPrefs.SetInt("Italy/4", int.Parse(dataDic ["ItalyTableCover4"].ToString()));
                            }

                            int AusTableTop = 0;
                            int.TryParse(dataDic ["AusTableTop"].ToString(), out AusTableTop);
                            if (AusTableTop > (PlayerPrefs.GetInt("Aus/top-shed-2")))
                            {
                                PlayerPrefs.SetInt("Aus/top-shed-2", int.Parse(dataDic ["AusTableTop"].ToString()));
                            }

                            int ausTableColor = 0;
                            int.TryParse(dataDic ["AusTableColor"].ToString(), out ausTableColor);
                            if (ausTableColor > (PlayerPrefs.GetInt("Aus/2")))
                            {
                                PlayerPrefs.SetInt("Aus/2", int.Parse(dataDic ["AusTableColor"].ToString()));
                            }
                            int ausTableColor3 = 0;
                            int.TryParse(dataDic ["AusTableColor3"].ToString(), out ausTableColor3);
                            if (ausTableColor3 > (PlayerPrefs.GetInt("Aus/3")))
                            {
                                PlayerPrefs.SetInt("Aus/3", int.Parse(dataDic ["AusTableColor3"].ToString()));
                            }
                            int ausTableColor4 = 0;
                            int.TryParse(dataDic ["AusTableColor4"].ToString(), out ausTableColor4);
                            if (ausTableColor4 > (PlayerPrefs.GetInt("Aus/4")))
                            {
                                PlayerPrefs.SetInt("Aus/4", int.Parse(dataDic ["AusTableColor4"].ToString()));
                            }

                            int bell = 0;
                            int.TryParse(dataDic ["Bell"].ToString(), out bell);
                            if (bell > (PlayerPrefs.GetInt("Bell")))
                            {
                                PlayerPrefs.SetInt("Bell", int.Parse(dataDic ["Bell"].ToString()));
                            }

                            int radio = 0;
                            int.TryParse(dataDic ["Radio"].ToString(), out radio);
                            if (radio > (PlayerPrefs.GetInt("Radio")))
                            {
                                PlayerPrefs.SetInt("Radio", int.Parse(dataDic ["Radio"].ToString()));
                            }

                            int special = 0;
                            int.TryParse(dataDic ["Special"].ToString(), out special);
                            if (special > (PlayerPrefs.GetInt("Whistle")))
                            {
                                PlayerPrefs.SetInt("Whistle", int.Parse(dataDic ["Special"].ToString()));
                            }

                            Debug.Log(dataDic ["ColaTraysLevel"].ToString());


                            Debug.Log(dataDic ["GrilUpLevel"].ToString());
                            Debug.Log(dataDic ["SoupBowlLevel"].ToString());
                            //GET DATA
                            //Update data
                            StartCoroutine(SendUpdatedData());
                        }

                        readyToProceed = true;
                        if (callingAfterLogin)
                        {
                            //UIManager.Instance.ActivePanelForThisKeyWithFadding("UserLevel");
                            Debug.Log(message);
                        }
                    }
                    else
                    {
                        Debug.Log(responseDic ["message"].ToString());
                        if (callingAfterLogin)
                        {
                            FB.LogOut();
                            PlayerPrefs.SetInt("FBLogin", 0);
                            //popupPanel.SetActive (true);
//						popupText.text = responseDic["message"].ToString();
                        }
                    }
                }
            }
        }
        //StartCoroutine(DeactivateLoader());
    }
Exemplo n.º 22
0
    // Use this for initialization
    void Awake()
    {
        _instance = this;
                #if UNITY_ANDROID
        if (GoogleMobileAdsDemoScript._instance != null)
        {
            GoogleMobileAdsDemoScript._instance.RequestInterstitial();
        }
#endif
        //PlayerPrefs.DeleteAll ();
        if (!PlayerPrefs.HasKey("PlateUpgrade"))
        {
            PlayerPrefs.SetString("Golds", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("TotalScore", EncryptionHandler64.Encrypt("0"));

            PlayerPrefs.SetString("Cupcake", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("Handcuff", EncryptionHandler64.Encrypt("0"));


            PlayerPrefs.SetString("GrillsUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("USCokeUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("PlateUpgrade", EncryptionHandler64.Encrypt("0"));


            PlayerPrefs.SetString("USStars", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("USLevels", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("US_TableCover", "US/base-flat-1");
            PlayerPrefs.SetString("US_TableTop", "US/top-floor-1");
            PlayerPrefs.SetInt("US/base-flat-1", 1);
            PlayerPrefs.SetInt("US/top-floor-1", 1);

            PlayerPrefs.SetString("AusLevels", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("ItalyLevels", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("ChinaLevels", EncryptionHandler64.Encrypt("0"));

            PlayerPrefs.SetString("ChinaStars", EncryptionHandler64.Encrypt("0"));

            PlayerPrefs.SetString("China_TableCover", "China/1");
            PlayerPrefs.SetString("China_TableTop", "China/a-1");
            PlayerPrefs.SetString("ChinaPlateUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("ChinaBowlsUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("ChinaPansUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("ChinaSoupContainerUpgrade", EncryptionHandler64.Encrypt("0"));

            PlayerPrefs.SetString("ItalyStars", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("Italy_TableCover", "Italy/1");
            PlayerPrefs.SetString("Italy_TableTop", "Italy/top-strip-1");
            PlayerPrefs.SetString("ItalyPlateUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("ItalyCokeUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("OvenUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetInt("Italy/1", 1);
            PlayerPrefs.SetInt("Italy/top-strip-1", 1);

            PlayerPrefs.SetInt("China/1", 1);
            PlayerPrefs.SetInt("China/a-1", 1);



            PlayerPrefs.SetString("AusStars", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("Aus_TableCover", "Aus/1");
            PlayerPrefs.SetString("Aus_TableTop", "Aus/top-shed-1");
            PlayerPrefs.SetString("AusPlateUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("FriesUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("AusCokeUpgrade", EncryptionHandler64.Encrypt("0"));
            PlayerPrefs.SetString("AusGrillsUpgrade", EncryptionHandler64.Encrypt("0"));

            PlayerPrefs.SetInt("Aus/1", 1);
            PlayerPrefs.SetInt("Aus/top-shed-1", 3);
        }

        //PlayerPrefs.SetString("Golds",EncryptionHandler64.Encrypt ("10000"));
        //	PlayerPrefs.SetString ("TotalScore",EncryptionHandler64.Encrypt ("10000"));
        goldText.text = EncryptionHandler64.Decrypt(PlayerPrefs.GetString("Golds")).ToString();
        StartCoroutine(ShowTarget());
    }
Exemplo n.º 23
0
    public void OnGameOver()
    {
        levelNoOfEnv = LevelManager.levelNo % 10;
        if (levelNoOfEnv == 0)
        {
            levelNoOfEnv = 10;
        }
        if (LevelManager.levelNo == 1)
        {
            upgrade_bttn.GetComponent <Animator> ().enabled = true;
            upback.SetActive(true);
            upgrade_hand.SetActive(true);
        }
        if (LevelManager.levelNo == 2)
        {
            achivment_bttn.GetComponent <Animator> ().enabled = true;
            //	achie_back.SetActive(true);
        }

        uiPanel.SetActive(false);
        gameOverPanel.SetActive(true);
        radio_audio.Stop();
        if (totalCoins >= LevelManager._instance.targetScore[LevelManager.levelNo])
        {
            adshow++;
            if (adshow == 2)
            {
#if UNITY_ANDROID
                GoogleMobileAdsDemoScript._instance.ShowInterstitial();
                                #elif UNITY_IOS || UNITY_IPHONE
                if (Chartboost.hasInterstitial(CBLocation.Default))
                {
                    Chartboost.showInterstitial(CBLocation.Default);
                    Debug.Log("Chartboost @UImanager");
                }
                else
                {
                    Chartboost.cacheInterstitial(CBLocation.Default);
                    Debug.Log("Chartboostcaching @UImanager");
                }
#endif
                adshow = 0;
            }
            gameover_effect.SetActive(true);

            LevelSoundManager._instance.successful_level.Play();

            Invoke("gameoversoundf", 1.5f);
            gameoverHeading.text = "successful day!";
            int noOfLevelsOpen = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString(MenuManager.envNo + "Levels"));
            //Debug.Log("noOfLevelsOpen = "+noOfLevelsOpen);

            if (levelNoOfEnv > noOfLevelsOpen)
            {
                PlayerPrefs.SetString(MenuManager.envNo + "Levels", EncryptionHandler64.Encrypt(levelNoOfEnv.ToString()));
            }
        }
        else
        {
            adshow++;
            if (adshow == 2)
            {
                                #if UNITY_IOS || UNITY_IPHONE
                if (Chartboost.hasInterstitial(CBLocation.Default))
                {
                    Chartboost.showInterstitial(CBLocation.Default);
                    Debug.Log("Chartboost2 @UImanager");
                }
                else
                {
                    Chartboost.cacheInterstitial(CBLocation.Default);
                    Debug.Log("Chartboostcaching2 @UImanager");
                }
#elif UNITY_ANDROID
                GoogleMobileAdsDemoScript._instance.ShowInterstitial();
#endif
                adshow = 0;
            }
            nextButton.interactable = false;
            LevelSoundManager._instance.unsuccessful_level.Play();
            //Invoke("gameoversoundf",1.5f);
            gameoverHeading.text = "unsuccessful day!";
            if (LevelManager.levelNo == 4 && ((!PlayerPrefs.HasKey("Radio") || MenuManager.handcuffNo <= 0)))
            {
                Unsucces++;
                PlayerPrefs.SetInt("Unsuccessful", Unsucces);
                {
                    if (PlayerPrefs.GetInt("Unsuccessful") == 2)
                    {
                        Invoke("BringRadiopopup", 1.25f);
                    }
                }
            }
        }
        dayEarningsHeading.text = "Day " + levelNoOfEnv + " Earnings";
        dayEarningsLabel.text   = totalCoins.ToString();
        int noOfStars = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString(MenuManager.envNo + "Stars"));

        for (int i = 0; i < stars.Length; i++)
        {
            if (i < noOfStars)
            {
                stars[i].gameObject.SetActive(true);
            }
        }

        MenuManager.totalscore += totalCoins;
        PlayerPrefs.SetString("TotalScore", EncryptionHandler64.Encrypt(MenuManager.totalscore.ToString()));

        totalScore.text = "Total Coins: " + MenuManager.totalscore.ToString();
        StartCoroutine(EarningsSlider());
    }
Exemplo n.º 24
0
    IEnumerator RestoreData()
    {
        string url = baseUrl + "getDetail";
        WWW    w   = new WWW(url);

        yield return(w);

        Debug.Log(w.text);


        if (w.error == null)
        {
            Debug.Log("error" + w.text);

            IDictionary responseDic = (IDictionary)Json.Deserialize(w.text);

            if (w.text.Contains("GrilUpLevel"))
            {
                PlayerPrefs.SetString("GrillsUpgrade", EncryptionHandler64.Encrypt("1"));
                Debug.Log("Done this ");

//				PlayerPrefs.SetString ("USCokeUpgrade", EncryptionHandler64.Encrypt ("0"));
//				PlayerPrefs.SetString ("PlateUpgrade", EncryptionHandler64.Encrypt ("0"));
//
//
//				PlayerPrefs.SetInt ("US/base-flat-1", 1);
//				PlayerPrefs.SetInt ("US/top-floor-1", 1);
//
//
//				PlayerPrefs.SetString ("China_TableCover", "China/1");
//				PlayerPrefs.SetString ("China_TableTop", "China/a-1");
//				PlayerPrefs.SetString ("ChinaPlateUpgrade", EncryptionHandler64.Encrypt ("0"));
//				PlayerPrefs.SetString ("ChinaBowlsUpgrade", EncryptionHandler64.Encrypt ("0"));
//				PlayerPrefs.SetString ("ChinaPansUpgrade", EncryptionHandler64.Encrypt ("0"));
//				PlayerPrefs.SetString ("ChinaSoupContainer", EncryptionHandler64.Encrypt ("0"));
//
//				PlayerPrefs.SetString ("Italy_TableCover", "Italy/1");
//				PlayerPrefs.SetString ("Italy_TableTop", "Italy/top-strip-1");
//				PlayerPrefs.SetString ("ItalyPlateUpgrade", EncryptionHandler64.Encrypt ("0"));
//				PlayerPrefs.SetString ("ItalyCokeUpgrade", EncryptionHandler64.Encrypt ("0"));
//				PlayerPrefs.SetString ("OvenUpgrade", EncryptionHandler64.Encrypt ("0"));
//				PlayerPrefs.SetInt ("Italy/1", 1);
//				PlayerPrefs.SetInt ("Italy/top-strip-1", 1);
//
//				PlayerPrefs.SetInt ("China/1", 1);
//				PlayerPrefs.SetInt ("China/a-1", 1);
//
//
//
//				PlayerPrefs.SetString ("AusPlateUpgrade", EncryptionHandler64.Encrypt ("0"));
//				PlayerPrefs.SetString ("FriesUpgrade", EncryptionHandler64.Encrypt ("0"));
//				PlayerPrefs.SetString ("AusCokeUpgrade", EncryptionHandler64.Encrypt ("0"));
//				PlayerPrefs.SetString ("AusGrillsUpgrade", EncryptionHandler64.Encrypt ("0"));
//
//				PlayerPrefs.SetInt ("Aus/1", 1);
//				PlayerPrefs.SetInt ("Aus/top-shed-1", 1);
            }
            else
            {
                Debug.Log("error" + w.text);
            }
        }
    }