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 OnEnable()
    {
        if (!myName.Contains("ItalyFridge"))
        {
            upgradeValue = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString(myName + "Upgrade"));
        }
        else
        {
            if (PlayerPrefs.HasKey(myName + "Upgrade"))
            {
                upgradeValue = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString(myName + "Upgrade"));
            }
            else
            {
                upgradeValue = 0;
            }
        }
        //	Debug.Log("myname = "+ myName+"Upgrade");
        //	Debug.Log("upgradeValue = "+upgradeValue);
        for (int i = 0; i <= upgradeValue; i++)
        {
            upgradeNoImages[i].SetActive(true);
        }

        if (myName == "Grills")
        {
            OnClickToShow();
        }
//			PlayerPrefs.SetInt (myName+"Upgrade",PlayerPrefs.GetInt (myName+"Upgrade")+1);
    }
Exemplo n.º 4
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.º 5
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.º 6
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.º 7
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.º 8
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.º 9
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.º 10
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.º 11
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.º 12
0
    public void ChinaLevel()
    {
        //2

        MenuManager._instance.Level_loaded = 2;
        MenuManager.envNo = "China";
        int noOfUSLevelsOpen = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("USLevels"));

        //Debug.Log ("NO of opne US " +noOfUSLevelsOpen);
        if (noOfUSLevelsOpen >= 10 || PlayerPrefs.HasKey("ChinaOpen"))
        {
            China_lock.SetActive(false);
            Destroy(gameObject);
            MenuManager._instance.EnableFadePanel();
            MenuManager._instance.levelPanel.SetActive(true);
        }
    }
Exemplo n.º 13
0
    void OnEnable()
    {
        myName = MenuManager.envNo + "Stars";
        //	LevelMade();


//		Debug.Log ("MenuManager.envNo = "+MenuManager.envNo);
//		Debug.Log ("MenuManager.envNo = "+PlayerPrefs.HasKey(MenuManager.envNo+"Levels"));
        int noOfLevelsCompleted = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString(MenuManager.envNo + "Levels"));

        myTick.SetActive(false);

        if (myLevel <= noOfLevelsCompleted)
        {
            myTick.SetActive(true);
            myLock.SetActive(false);
        }
        else if (myLevel != ((noOfLevelsCompleted + 1)))
        {
            myLock.SetActive(true);
            myTick.SetActive(false);
        }
        else if (myLevel == (noOfLevelsCompleted + 1))
        {
            myLock.SetActive(false);
        }
        if (myLevel > (noOfLevelsCompleted + 1))
        {
            transform.GetComponent <Button> ().enabled = false;
        }
        else
        {
            transform.GetComponent <Button> ().enabled = true;
        }


        if (PlayerPrefs.HasKey(myName + "" + myLevel))
        {
            myStar.SetActive(true);
        }
        else
        {
            myStar.SetActive(false);
        }
    }
Exemplo n.º 14
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.º 15
0
    public void AustraliaLevel()
    {
        //4


        MenuManager._instance.Level_loaded = 4;
        MenuManager.envNo = "Aus";
        int noOfItalyLevelsOpen = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ItalyLevels"));

        //Debug.Log ("NO of opne italy " + noOfItalyLevelsOpen);
        if (noOfItalyLevelsOpen >= 10 || PlayerPrefs.HasKey("AusOpen"))
        {
            Aus_lock.SetActive(false);
            Destroy(gameObject);
            MenuManager._instance.EnableFadePanel();
            MenuManager._instance.levelPanel.SetActive(true);
        }
    }
Exemplo n.º 16
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.º 17
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.º 18
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.º 19
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.º 20
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.º 21
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.º 22
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.º 23
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.º 24
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.º 25
0
    IEnumerator SendUpdatedData()
    {
        if (FB.IsLoggedIn && Application.internetReachability != NetworkReachability.NotReachable)
        {
            string  url   = baseUrl + "create";
            WWWForm wForm = new WWWForm();
            wForm.AddField("access_token", AccessToken.CurrentAccessToken.TokenString);
            //23 keys


            wForm.AddField("GrilUpLevel", EncryptionHandler64.Decrypt(PlayerPrefs.GetString("GrillsUpgrade")).ToString());
            wForm.AddField("ColaTraysLevel", EncryptionHandler64.Decrypt(PlayerPrefs.GetString("USCokeUpgrade")).ToString());
            wForm.AddField("HotTraysLevel", EncryptionHandler64.Decrypt(PlayerPrefs.GetString("PlateUpgrade")).ToString());
            wForm.AddField("SoupBowlLevel", EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ChinaBowlsUpgrade")).ToString());
            wForm.AddField("SkilletLevel", EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ChinaPansUpgrade")).ToString());
            wForm.AddField("StockPotLevel", EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ChinaSoupContainerUpgrade")).ToString());
            wForm.AddField("NoodleDishesLevel", EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ChinaPlateUpgrade")).ToString());
            wForm.AddField("ColaTraysItalyLevel", EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ItalyCokeUpgrade")).ToString());
            wForm.AddField("DishesLevel", EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ItalyPlateUpgrade")).ToString());
            wForm.AddField("OvenLevel", EncryptionHandler64.Decrypt(PlayerPrefs.GetString("OvenUpgrade")).ToString());
            wForm.AddField("DishesAusLevel", EncryptionHandler64.Decrypt(PlayerPrefs.GetString("AusPlateUpgrade")).ToString());
            wForm.AddField("ColaTraysAusLevel", EncryptionHandler64.Decrypt(PlayerPrefs.GetString("AusCokeUpgrade")).ToString());
            wForm.AddField("DeepFrierLevel", EncryptionHandler64.Decrypt(PlayerPrefs.GetString("FriesUpgrade")).ToString());
            wForm.AddField("GrillUpAusLevel", EncryptionHandler64.Decrypt(PlayerPrefs.GetString("AusGrillsUpgrade")).ToString());
            wForm.AddField("FridgeLevel", PlayerPrefs.GetInt("Fridge").ToString());


            wForm.AddField("UsTableCover", PlayerPrefs.GetInt("US/base-flat-2").ToString());
            wForm.AddField("UsTableCover3", PlayerPrefs.GetInt("US/base-flat-3").ToString());
            wForm.AddField("UsTableCover4", PlayerPrefs.GetInt("US/base-flat-4").ToString());

            wForm.AddField("ChinaTableTop", PlayerPrefs.GetInt("China/a-2").ToString());
            wForm.AddField("ChinaTableTop3", PlayerPrefs.GetInt("China/a-3").ToString());
            wForm.AddField("ChinaTableTop4", PlayerPrefs.GetInt("China/a-4").ToString());

            wForm.AddField("ChinaTableCover", PlayerPrefs.GetInt("China/2").ToString());
            wForm.AddField("ChinaTableCover3", PlayerPrefs.GetInt("China/3").ToString());
            wForm.AddField("ChinaTableCover4", PlayerPrefs.GetInt("China/4").ToString());


            wForm.AddField("ItalyTableTop", PlayerPrefs.GetInt("Italy/top-strip-2").ToString());

            wForm.AddField("ItalyTableCover", PlayerPrefs.GetInt("Italy/2").ToString());
            wForm.AddField("ItalyTableCover3", PlayerPrefs.GetInt("Italy/3").ToString());
            wForm.AddField("ItalyTableCover4", PlayerPrefs.GetInt("Italy/4").ToString());

            wForm.AddField("AusTableTop", PlayerPrefs.GetInt("Aus/top-shed-2").ToString());

            wForm.AddField("AusTableColor", PlayerPrefs.GetInt("Aus/2").ToString());
            wForm.AddField("AusTableColor3", PlayerPrefs.GetInt("Aus/3").ToString());
            wForm.AddField("AusTableColor4", PlayerPrefs.GetInt("Aus/4").ToString());

            wForm.AddField("Radio", PlayerPrefs.GetInt("Radio").ToString());
            wForm.AddField("Bell", PlayerPrefs.GetInt("Bell").ToString());
            wForm.AddField("Special", PlayerPrefs.GetInt("Whistle").ToString());


            Debug.LogError("aaaaaaaaaaaaaa");
            //Debug.Log(PlayerPrefs.GetString("Aus_TableTop"));

            WWW wLogin = new WWW(url, wForm);
            yield return(wLogin);

            if (wLogin.error == null)
            {
                Debug.Log("aaa" + wLogin.text);
                if (wLogin.text.Contains("status"))
                {
                    IDictionary responseDic = (IDictionary)Json.Deserialize(wLogin.text);
                    string      status      = responseDic ["status"].ToString();
                    if (status == "success")
                    {
                        Debug.Log(responseDic ["message"].ToString());
                    }
                    else
                    {
                        Debug.Log(responseDic ["message"].ToString());
                    }
                }
            }
        }
    }
Exemplo n.º 26
0
    void Start()
    {
        US_Manager.tutorialEnd        = false;
        Italy_Manager.tutorialEnd     = false;
        Australia_Manager.tutorialEnd = false;
        PlayerPrefs.SetInt("ChinaOpen", 1);
        c           = true;
        tutorialEnd = false;

//		Debug.Log("LevelManager.levelNo = "+LevelManager.levelNo);
        if (LevelManager.levelNo <= 12)
        {
            soupVeg.gameObject.SetActive(false);
            bowlAdd.gameObject.SetActive(false);
//			tutorialEnd = true;
        }
        else if (LevelManager.levelNo != 13)
        {
//			tutorialEnd = true;
        }

        int platesUpgradeValue = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ChinaPlateUpgrade"));

        //Debug.Log("platesUpgradeValue = "+platesUpgradeValue);

        totalPlatesAvailable = 2 + (platesUpgradeValue * 2);


        int bowlUpgrade = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ChinaBowlsUpgrade"));

        //Debug.Log("bowlUpgrade = "+bowlUpgrade);

        totalBowlsAvailable = 2 + (bowlUpgrade * 2);


        pansUpgrade = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ChinaPansUpgrade"));
        pansUpgrade++;
        //Debug.Log("pansUpgrade = "+pansUpgrade);

        for (int i = 0; i < pansUpgrade; i++)
        {
            pans[i].SetActive(true);
        }

        soupContainerUpgrade = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("ChinaSoupContainerUpgrade"));
        soupContainerUpgrade++;
        //Debug.Log("soupContainerUpgrade = "+soupContainerUpgrade);

        if (LevelManager.levelNo >= 13)
        {
            for (int i = 0; i < soupContainerUpgrade; i++)
            {
                soupContainer [i].SetActive(true);
            }
        }
        //	Debug.Log(PlayerPrefs.GetString ("China_TableCover"));

        char [] coverVal = PlayerPrefs.GetString("China_TableCover").ToCharArray();

        UIManager._instance._tabelcover = int.Parse(coverVal[coverVal.Length - 1].ToString());



        //	Debug.Log( "val = "+UIManager._instance._tabelcover);

        char [] coverVal2 = PlayerPrefs.GetString("China_TableTop").ToCharArray();

        UIManager._instance._tabeltop = int.Parse(coverVal[coverVal.Length - 1].ToString());

        //	Debug.Log( "val = "+UIManager._instance._tabeltop);
        tableCover.sprite = Resources.Load <Sprite> (PlayerPrefs.GetString("China_TableTop")) as Sprite;
        tableTop.sprite   = Resources.Load <Sprite> (PlayerPrefs.GetString("China_TableCover")) as Sprite;
        if (MenuManager.cupcakeNo <= 0)
        {
            cupCake.gameObject.SetActive(false);
        }
        UIManager._instance.ForCoinAdd();
    }
Exemplo n.º 27
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.º 28
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.º 29
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);
            }
        }
    }
Exemplo n.º 30
0
    void Start()
    {
        PlayerPrefs.SetInt("AusOpen", 1);
        US_Manager.tutorialEnd    = false;
        Italy_Manager.tutorialEnd = false;
        China_Manager.tutorialEnd = false;
        a = true;
        if (LevelManager.levelNo == 31)
        {
            starting_text.SetActive(true);
        }
        tutorialEnd = false;
        if (LevelManager.levelNo == 31)
        {
            tomatoAdd.gameObject.SetActive(false);

            onionAdd.gameObject.SetActive(false);

            cabbageAdd.gameObject.SetActive(false);

            friesAdd.gameObject.SetActive(false);
        }
        else if (LevelManager.levelNo == 32)         // bring fries
        {
            tomatoAdd.gameObject.SetActive(false);

            onionAdd.gameObject.SetActive(false);

            cabbageAdd.gameObject.SetActive(false);
        }
        else if (LevelManager.levelNo == 33)        // tomato n onion,, level 34 has cabbage
        {
            cabbageAdd.gameObject.SetActive(false);
        }
        else if (LevelManager.levelNo > 34)
        {
//			tutorialEnd = true;
        }

        int platesUpgradeValue = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("AusPlateUpgrade"));

        //Debug.Log("platesUpgradeValue = "+platesUpgradeValue);

        totalPlatesAvailable = 2 + (platesUpgradeValue * 2);
        for (int i = 0; i < totalPlatesAvailable; i++)
        {
            burgerPlates[i].color = new Color(1, 1, 1, 1);
        }

        int friesUpgradeValue = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("FriesUpgrade"));

        //Debug.Log("friesUpgradeValue = "+friesUpgradeValue);
        totalFriesAvailable = 2 + (friesUpgradeValue * 2);
        fryer.sprite        = fryerVariations[friesUpgradeValue];
        for (int i = 0; i <= friesUpgradeValue; i++)
        {
            friesCluster[i].SetActive(true);
        }

        int cokeUpgradeValue = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("AusCokeUpgrade"));

        //Debug.Log("cokeUpgradeValue = "+cokeUpgradeValue);
        totalCokesAvailable = 3 + (cokeUpgradeValue * 3);

        int grillsToUpgrade = (int)EncryptionHandler64.Decrypt(PlayerPrefs.GetString("AusGrillsUpgrade"));

        //Debug.Log("grillsToUpgrade = "+grillsToUpgrade);
        totalGrillsAvailable = 2 + (grillsToUpgrade * 2);

        int grillVal = (int)totalGrillsAvailable / 2;

        //Debug.Log("grillVal = "+grillVal);
        for (int i = 0; i < grillVal; i++)
        {
            grills[i].SetActive(true);
        }
        //Debug.Log(PlayerPrefs.GetString ("Aus_TableCover"));

        char [] coverVal = PlayerPrefs.GetString("Aus_TableCover").ToCharArray();

        UIManager._instance._tabelcover = int.Parse(coverVal[coverVal.Length - 1].ToString());

        //	Debug.Log( "val = "+AUS_last1);

        char [] coverVal2 = PlayerPrefs.GetString("Aus_TableTop").ToCharArray();

        UIManager._instance._tabeltop = int.Parse(coverVal[coverVal.Length - 1].ToString());

        //	Debug.Log( "val = "+AUS_last2);

        tableCover.sprite = Resources.Load <Sprite> (PlayerPrefs.GetString("Aus_TableCover"));
        tableTop.sprite   = Resources.Load <Sprite> (PlayerPrefs.GetString("Aus_TableTop"));
        if (MenuManager.cupcakeNo <= 0)
        {
            cupCake.gameObject.SetActive(false);
        }
        UIManager._instance.ForCoinAdd();
    }