Beispiel #1
0
    private void OnPurchaseSucceded(Purchase purchase)
    {
        Debug.Log("Purchase succeded: " + purchase.Sku + "; Payload: " + purchase.DeveloperPayload);

        switch (purchase.Sku)
        {
        case SKU_10:
            ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") + 10000);
            break;

        case SKU_50:
            ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") + 50000);
            break;

        case SKU_100:
            ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") + 100000);
            break;

        case SKU_Life:
            ProtectedPrefs.SetInt("mLamp", ProtectedPrefs.GetInt("mLamp") + 10);
            break;

        default:
            Debug.LogWarning("Unknown SKU: " + purchase.Sku);
            break;
        }
    }
Beispiel #2
0
    void AdCallbackhandler(ShowResult result)
    {
        switch (result)
        {
        case ShowResult.Finished:
            Debug.Log("Ad Finished. Rewarding player...");
            if (freecoin)
            {
                ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") + 500);
                freecoin = false;
            }
            else
            {
                InstansShow();
            }

            break;

        case ShowResult.Skipped:
            Debug.Log("Ad skipped. Son, I am dissapointed in you");
            break;

        case ShowResult.Failed:
            Debug.Log("I swear this has never happened to me before");
            break;
        }
    }
Beispiel #3
0
    void Start()
    {
        GetGift();
        switch (ProtectedPrefs.GetInt("DaysCount"))
        {
        case 1:
            giftText.text     = "DAY 1: Your bonus + 300 Coin";
            giftProgress.size = 0.2f;
            break;

        case 2:
            giftText.text     = "DAY 2: Your bonus + 900 Coin";
            giftProgress.size = 0.4f;
            break;

        case 3:
            giftText.text     = "DAY 3: Your bonus + 1500 Coin";
            giftProgress.size = 0.6f;
            break;

        case 4:
            giftText.text     = "DAY 4: Your bonus + 2000 Coin";
            giftProgress.size = 0.8f;
            break;

        case 5:
            giftText.text     = "DAY 5: Your bonus + 5000 Coin";
            giftProgress.size = 1.0f;
            break;
        }
    }
Beispiel #4
0
 public void DoubleUp()
 {
     if (ProtectedPrefs.GetInt("Coins") >= 750 && dcLevel == 0)
     {
         ProtectedPrefs.SetInt("d_LvL", 1);
         ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") - 750);
     }
     else if (ProtectedPrefs.GetInt("Coins") >= 2500 && dcLevel == 1)
     {
         ProtectedPrefs.SetInt("d_LvL", 2);
         ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") - 2500);
     }
     else if (ProtectedPrefs.GetInt("Coins") >= 5000 && dcLevel == 2)
     {
         ProtectedPrefs.SetInt("d_LvL", 3);
         ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") - 5000);
     }
     else if (ProtectedPrefs.GetInt("Coins") >= 7500 && dcLevel == 3)
     {
         ProtectedPrefs.SetInt("d_LvL", 4);
         ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") - 7500);
     }
     else if (ProtectedPrefs.GetInt("Coins") >= 10000 && dcLevel == 4)
     {
         ProtectedPrefs.SetInt("d_LvL", 5);
         ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") - 10000);
     }
 }
Beispiel #5
0
 public void noADS()
 {
     if (ProtectedPrefs.GetInt("Coins") >= 999000 && ProtectedPrefs.GetInt("bunner") == 0)
     {
         ProtectedPrefs.SetInt("bunner", 1);
         ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") - 999000);
     }
 }
Beispiel #6
0
    void Load()
    {
        DaysCount = ProtectedPrefs.GetInt("DaysCount");

        if (ProtectedPrefs.HasKey("LastGiftDateTime"))
        {
            LastGiftDateTime = DateTime.Parse(ProtectedPrefs.GetString("LastGiftDateTime"));
        }
    }
Beispiel #7
0
 void Update()
 {
     if (Controller.iDie)
     {
         sourcebg.mute = true;
     }
     else if (GameControll.SaveMe && ProtectedPrefs.GetInt("Mute") != 0)
     {
         sourcebg.mute = false;
     }
 }
Beispiel #8
0
 public static IEnumerator SetScore()
 {
     if (FB.IsLoggedIn)
     {
         var scoreData = new Dictionary <string, string> ();
         scoreData ["score"] = ProtectedPrefs.GetInt("HighScore").ToString();
         FB.API("/me/scores", HttpMethod.POST, delegate(IGraphResult result) {
             print("Score result" + result.Error);
         }, scoreData);
     }
     yield return(1);
 }
Beispiel #9
0
 public void GetLamp()
 {
     if (ProtectedPrefs.HasKey("mLamp"))
     {
         lCount = ProtectedPrefs.GetInt("mLamp");
     }
     else
     {
         lCount = 0;
     }
     itemAbsorb.getLamp = false;
     lamlCount.text     = lCount.ToString();
 }
Beispiel #10
0
 public void ShareWithFriends()
 {
     if (FB.IsLoggedIn)
     {
         FB.FeedShare(
             string.Empty,
             new Uri("https://play.google.com/store/apps/details?id=com.vade.eastRunner"),
             " DESERT PRINCE RUNNER",
             " Come play this amazing game!",
             string.Format("{0} {1}", "My best score: ", ProtectedPrefs.GetInt("HighScore").ToString()),
             new Uri("http://cs627617.vk.me/v627617962/7156b/xMRVCMVBzWE.jpg"),
             string.Empty,
             this.sharCall);
     }
 }
Beispiel #11
0
 void Start()
 {
     instance = this;
     check    = false;
     if (ProtectedPrefs.HasKey("login"))
     {
         lg = ProtectedPrefs.GetInt("login");
     }
     if (lg == 0)
     {
         login = false;
     }
     else
     {
         login = true;
     }
 }
Beispiel #12
0
    void Start()
    {
        freecoin = false;
        if (ProtectedPrefs.HasKey("Coins"))
        {
            coinsc2 = ProtectedPrefs.GetInt("Coins");
        }
        else
        {
            coinsc2 = 0;
        }
        BookCount    = ProtectedPrefs.GetInt("mBook");
        GoldCount    = ProtectedPrefs.GetInt("mGold");
        EmeraldCount = ProtectedPrefs.GetInt("mEmerald");
        PipeCount    = ProtectedPrefs.GetInt("mPipe");
        bonuseNumber = Random.Range(0, 7);
        switch (bonuseNumber)
        {
        case 1:
            bonusName = "Take 250 coins";
            break;

        case 2:
            bonusName = "Take 3 books";
            break;

        case 3:
            bonusName = "Take 2 pipes";
            break;

        case 4:
            bonusName = "Take 4 emeralds";
            break;

        case 5:
            bonusName = "Take 2 golds";
            break;

        default:
            bonusName = "Take 100 coins";
            break;
        }
    }
Beispiel #13
0
 void Start()
 {
     fb = false;
     if (ProtectedPrefs.HasKey("Mute"))
     {
         if (ProtectedPrefs.GetInt("Mute") == 0)
         {
             bAudio.mute = true;
             muteBtn.SetActive(true);
             uMuteBtn.SetActive(false);
         }
         else
         {
             bAudio.mute = false;
             uMuteBtn.SetActive(true);
             muteBtn.SetActive(false);
         }
     }
 }
Beispiel #14
0
 void Start()
 {
     coin             = 0;
     changeScorecolor = false;
     distance.color   = new Color(1, 1, 1, 1);
     pause            = false;
     showAd           = false;
     al         = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <AudioListener>();
     al.enabled = true;
     if (ProtectedPrefs.HasKey("Coins"))
     {
         lcoin = ProtectedPrefs.GetInt("Coins");
     }
     else
     {
         lcoin = 0;
     }
     GetLamp();
     sl = saveButton.GetComponent <Image>();
 }
Beispiel #15
0
    IEnumerator Background()
    {
        yield return(new WaitForSeconds(.1f));

        go              = new GameObject("Audio Background");
        sourcebg        = go.AddComponent <AudioSource>();
        sourcebg.clip   = backgroundClip;
        sourcebg.volume = 0.5f;
        sourcebg.loop   = true;
        if (ProtectedPrefs.HasKey("Mute"))
        {
            if (ProtectedPrefs.GetInt("Mute") == 0)
            {
                sourcebg.mute = true;
            }
            else
            {
                sourcebg.mute = false;
            }
        }
        sourcebg.Play();
    }
Beispiel #16
0
    void Awake()
    {
        if (ProtectedPrefs.HasKey("Coins"))
        {
            coinGift = ProtectedPrefs.GetInt("Coins");
        }

        this.Start((days) =>
        {
            days++;

            switch (days)
            {
            case 1:
                giftText.text = "DAY 1: Your bonus + 300 Coin";
                ProtectedPrefs.SetInt("Coins", coinGift + 300);
                giftProgress.size = 0.2f;
                break;

            case 2:
                giftText.text = "DAY 2: Your bonus + 900 Coin";
                ProtectedPrefs.SetInt("Coins", coinGift + 900);
                giftProgress.size = 0.4f;
                break;

            case 3:
                giftText.text = "DAY 3: Your bonus + 1500 Coin";
                ProtectedPrefs.SetInt("Coins", coinGift + 1500);
                giftProgress.size = 0.6f;
                break;

            case 4:
                giftText.text = "DAY 4: Your bonus + 2000 Coin";
                ProtectedPrefs.SetInt("Coins", coinGift + 2000);
                giftProgress.size = 0.8f;
                break;

            case 5:
                giftText.text = "DAY 5: Your bonus + 5000 Coin";
                ProtectedPrefs.SetInt("Coins", coinGift + 5000);
                giftProgress.size = 1.0f;
                break;
            }
        },
                   5,
                   new []
        {
            "1 Day",
            "2 Day",
            "3 Day",
            "4 Day",
            "5 Day"
        },
                   new []
        {
            "300 GOlD",
            "900 GOlD",
            "1500 GOlD",
            "2000 GOlD",
            "5000 GOlD"
        }
                   );
    }
Beispiel #17
0
    void Start()
    {
        dieEffect.SetActive(false);
        shieldEffect.SetActive(false);
        Distance = 0;
        speed    = 10f;
        // controll
        fInitialX       = 0.0f;
        fInitialY       = 0.0f;
        fFinalX         = 0.0f;
        fFinalY         = 0.0f;
        inputX          = 0.0f;
        inputY          = 0.0f;
        iTouchStateFlag = 0;
        sSwipeDirection = SwipeDirection.Null;
        //end controll
        animationManager = this.GetComponent <AnimationManager>();
        controller       = this.GetComponent <CharacterController>();
        ShadowPlane      = transform.Find("ShadowPlane");
        iFly             = iDie = iMagnet = doubleJump = false;
        canControl       = true;
        cF  = cJ = cM = 0f;
        mgn = ProtectedPrefs.GetInt("m_LvL");
        kvr = ProtectedPrefs.GetInt("k_LvL");
        x2t = ProtectedPrefs.GetInt("d_LvL");
        bts = ProtectedPrefs.GetInt("b_LvL");

        if (mgn == 1)
        {
            magnetTime = 15f;
        }
        else if (mgn == 2)
        {
            magnetTime = 20f;
        }
        else if (mgn == 3)
        {
            magnetTime = 25f;
        }
        else if (mgn == 4)
        {
            magnetTime = 30f;
        }
        else if (mgn == 5)
        {
            magnetTime = 35f;
        }
        else
        {
            magnetTime = 10f;
        }

        if (kvr == 1)
        {
            flyTime = 15f;
        }
        else if (kvr == 2)
        {
            flyTime = 20f;
        }
        else if (kvr == 3)
        {
            flyTime = 25f;
        }
        else if (kvr == 4)
        {
            flyTime = 30f;
        }
        else if (kvr == 5)
        {
            flyTime = 35f;
        }
        else
        {
            flyTime = 10f;
        }

        if (x2t == 1)
        {
            doubleCoinTime = 15f;
        }
        else if (x2t == 2)
        {
            doubleCoinTime = 20f;
        }
        else if (x2t == 3)
        {
            doubleCoinTime = 25f;
        }
        else if (x2t == 4)
        {
            doubleCoinTime = 30f;
        }
        else if (x2t == 5)
        {
            doubleCoinTime = 35f;
        }
        else
        {
            doubleCoinTime = 10f;
        }

        if (bts == 1)
        {
            doubleJumpTime = 15f;
        }
        else if (bts == 2)
        {
            doubleJumpTime = 20f;
        }
        else if (bts == 3)
        {
            doubleJumpTime = 25f;
        }
        else if (bts == 4)
        {
            doubleJumpTime = 30f;
        }
        else if (bts == 5)
        {
            doubleJumpTime = 35f;
        }
        else
        {
            doubleJumpTime = 10f;
        }

        Invoke("StartEffect", 1f);
    }
Beispiel #18
0
    public void SelectBtn()
    {
        if (charSelect)
        {
            if (charId == 0)
            {
                ProtectedPrefs.SetInt("Player", 1);
                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
            else if (charId == 1)
            {
                ProtectedPrefs.SetInt("Player", 2);
                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
            else if (charId == 2)
            {
                ProtectedPrefs.SetInt("Player", 3);
                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
            else if (charId == 3)
            {
                ProtectedPrefs.SetInt("Player", 4);
                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
        }

        if (capSelect)
        {
            if (capId == 0)
            {
                ProtectedPrefs.SetInt("Helmet", 1);
                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
            else if (capId == 1)
            {
                ProtectedPrefs.SetInt("Helmet", 2);
                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
            else if (capId == 2)
            {
                ProtectedPrefs.SetInt("Helmet", 3);
                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
            else if (capId == 3)
            {
                ProtectedPrefs.SetInt("Helmet", 4);
                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
        }

        if (knifSelect)
        {
            if (knifeId == 0)
            {
                ProtectedPrefs.SetInt("Whinger", 1);
                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
            else if (knifeId == 1)
            {
                ProtectedPrefs.SetInt("Whinger", 2);
                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
            else if (knifeId == 2)
            {
                ProtectedPrefs.SetInt("Whinger", 3);
                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
            else if (knifeId == 3)
            {
                ProtectedPrefs.SetInt("Whinger", 4);
                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
            else if (knifeId == 4)
            {
                ProtectedPrefs.SetInt("Whinger", 5);
                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
        }
        if (otherSelect)
        {
            if (curObjectNumber == 0)
            {
                if (ProtectedPrefs.GetInt("ClockStart") != 1)
                {
                    ProtectedPrefs.SetInt("ClockStart", 1);
                }
                else
                {
                    ProtectedPrefs.SetInt("ClockStart", 0);
                }

                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
            else if (curObjectNumber == 1)
            {
                if (ProtectedPrefs.GetInt("AkStart") != 1)
                {
                    ProtectedPrefs.SetInt("AkStart", 1);
                }
                else
                {
                    ProtectedPrefs.SetInt("AkStart", 0);
                }
                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
            else if (curObjectNumber == 2)
            {
                if (ProtectedPrefs.GetInt("SpectatesStart") != 1)
                {
                    ProtectedPrefs.SetInt("SpectatesStart", 1);
                }
                else
                {
                    ProtectedPrefs.SetInt("SpectatesStart", 0);
                }
                animationManager.animationState = animationManager.Select;
                selectBtn.GetComponent <Button>().IsActive();
            }
        }
    }
Beispiel #19
0
    void Update()
    {
        if (Input.GetKey(KeyCode.Escape))
        {
            mainPanel.SetActive(false);
            quitPanel.SetActive(true);
            fbWindow.SetActive(false);
            fbNotLog.SetActive(false);
            leaderBoard.SetActive(false);
            storeWindow.SetActive(false);
            cameraSecond.SetActive(false);
            iapPanel.SetActive(false);
        }
        if (!Facebook.Unity.FBManager.login)
        {
            fbWindow.SetActive(false);
        }
        else
        {
            fbNotLog.SetActive(false);
        }

        if (ProtectedPrefs.GetInt("bunner") == 0)
        {
            tnoAds.text = "999000";
        }
        else
        {
            tnoAds.text = "Full!";
        }
        if (ProtectedPrefs.HasKey("Coins"))
        {
            coins.text = ProtectedPrefs.GetInt("Coins").ToString();
        }

        if (ProtectedPrefs.HasKey("m_LvL"))
        {
            magLevel = ProtectedPrefs.GetInt("m_LvL");
        }
        else
        {
            magLevel           = 0;
            magnetP.fillAmount = 0f;
            tMagnit.text       = "750";
        }
        if (magLevel == 1)
        {
            magnetP.fillAmount = 0.2f;
            tMagnit.text       = "2 500";
        }
        else if (magLevel == 2)
        {
            magnetP.fillAmount = 0.4f;
            tMagnit.text       = "5 000";
        }
        else if (magLevel == 3)
        {
            magnetP.fillAmount = 0.6f;
            tMagnit.text       = "7 500";
        }
        else if (magLevel == 4)
        {
            magnetP.fillAmount = 0.8f;
            tMagnit.text       = "10 000";
        }
        else if (magLevel == 5)
        {
            magnetP.fillAmount = 1f;
            tMagnit.text       = "Full!";
        }

        if (ProtectedPrefs.HasKey("b_LvL"))
        {
            botLevel = ProtectedPrefs.GetInt("b_LvL");
        }
        else
        {
            botLevel           = 0;
            ShouseP.fillAmount = 0f;
            tShouses.text      = "750";
        }
        if (botLevel == 1)
        {
            ShouseP.fillAmount = 0.2f;
            tShouses.text      = "2 500";
        }
        else if (botLevel == 2)
        {
            ShouseP.fillAmount = 0.4f;
            tShouses.text      = "5 000";
        }
        else if (botLevel == 3)
        {
            ShouseP.fillAmount = 0.6f;
            tShouses.text      = "7 500";
        }
        else if (botLevel == 4)
        {
            ShouseP.fillAmount = 0.8f;
            tShouses.text      = "10 000";
        }
        else if (botLevel == 5)
        {
            ShouseP.fillAmount = 1f;
            tShouses.text      = "Full!";
        }

        if (ProtectedPrefs.HasKey("k_LvL"))
        {
            koverLevel = ProtectedPrefs.GetInt("k_LvL");
        }
        else
        {
            koverLevel        = 0;
            KoverP.fillAmount = 0f;
            tKover.text       = "750";
        }
        if (koverLevel == 1)
        {
            KoverP.fillAmount = 0.2f;
            tKover.text       = "2 500";
        }
        else if (koverLevel == 2)
        {
            KoverP.fillAmount = 0.4f;
            tKover.text       = "5 000";
        }
        else if (koverLevel == 3)
        {
            KoverP.fillAmount = 0.6f;
            tKover.text       = "7 500";
        }
        else if (koverLevel == 4)
        {
            KoverP.fillAmount = 0.8f;
            tKover.text       = "10 000";
        }
        else if (koverLevel == 5)
        {
            KoverP.fillAmount = 1f;
            tKover.text       = "Full!";
        }

        if (ProtectedPrefs.HasKey("d_LvL"))
        {
            dcLevel = ProtectedPrefs.GetInt("d_LvL");
        }
        else
        {
            dcLevel          = 0;
            dcP.fillAmount   = 0f;
            tdoublecoin.text = "750";
        }
        if (dcLevel == 1)
        {
            dcP.fillAmount   = 0.2f;
            tdoublecoin.text = "2 500";
        }
        else if (dcLevel == 2)
        {
            dcP.fillAmount   = 0.4f;
            tdoublecoin.text = "5 000";
        }
        else if (dcLevel == 3)
        {
            dcP.fillAmount   = 0.6f;
            tdoublecoin.text = "7 500";
        }
        else if (dcLevel == 4)
        {
            dcP.fillAmount   = 0.8f;
            tdoublecoin.text = "10 000";
        }
        else if (dcLevel == 5)
        {
            dcP.fillAmount   = 1f;
            tdoublecoin.text = "Full!";
        }
    }
Beispiel #20
0
 public void Shop()
 {
     coins.text = ProtectedPrefs.GetInt("Coins").ToString();
 }
Beispiel #21
0
    void Update()
    {
        if (Input.GetKey(KeyCode.Escape))
        {
            CloseStore();
        }

        if (store)
        {
            if (curObjectNumber < 0)
            {
                curObjectNumber = 0;
            }


            if (ProtectedPrefs.GetInt("Characters") == 2 && ProtectedPrefs.GetInt("Cap") == 0)
            {
                caps[0].SetActive(false);
                capChar3.SetActive(true);
            }
            else
            {
                capChar3.SetActive(false);
            }



            if (!charSelect)
            {
                if (ProtectedPrefs.GetInt("Player") == 1)
                {
                    characters[0].SetActive(true);
                    characters[1].SetActive(false);
                    characters[2].SetActive(false);
                    characters[3].SetActive(false);
                    bear.SetActive(false);
                    jacket[0].SetActive(false);
                    jacket[1].SetActive(false);
                    belt[0].SetActive(false);
                    belt[1].SetActive(false);
                    belt[2].SetActive(false);
                    MaskAnonim.SetActive(false);
                }
                else if (ProtectedPrefs.GetInt("Player") == 2)
                {
                    characters[0].SetActive(false);
                    characters[1].SetActive(true);
                    characters[2].SetActive(false);
                    characters[3].SetActive(false);
                    bear.SetActive(true);
                    jacket[0].SetActive(false);
                    jacket[1].SetActive(true);
                    belt[0].SetActive(true);
                    belt[1].SetActive(false);
                    belt[2].SetActive(false);
                    MaskAnonim.SetActive(false);
                }
                else if (ProtectedPrefs.GetInt("Player") == 3)
                {
                    characters[0].SetActive(false);
                    characters[1].SetActive(false);
                    characters[2].SetActive(true);
                    characters[3].SetActive(false);
                    bear.SetActive(false);
                    jacket[0].SetActive(false);
                    jacket[1].SetActive(false);
                    belt[0].SetActive(false);
                    belt[1].SetActive(true);
                    belt[2].SetActive(false);
                    MaskAnonim.SetActive(false);
                }
                else if (ProtectedPrefs.GetInt("Player") == 4)
                {
                    characters[0].SetActive(false);
                    characters[1].SetActive(false);
                    characters[2].SetActive(false);
                    characters[3].SetActive(true);
                    bear.SetActive(false);
                    jacket[0].SetActive(true);
                    jacket[1].SetActive(false);
                    belt[0].SetActive(false);
                    belt[1].SetActive(false);
                    belt[2].SetActive(true);
                    MaskAnonim.SetActive(true);
                    ocular.SetActive(false);
                }
                else
                {
                    characters[0].SetActive(true);
                    characters[1].SetActive(false);
                    characters[2].SetActive(false);
                    characters[3].SetActive(false);
                    bear.SetActive(false);
                    jacket[0].SetActive(false);
                    jacket[1].SetActive(false);
                    belt[0].SetActive(false);
                    belt[1].SetActive(false);
                    belt[2].SetActive(false);
                    MaskAnonim.SetActive(false);
                }
            }
            else
            {
                if (curObjectNumber > characters.Length - 1)
                {
                    curObjectNumber = characters.Length - 1;
                }
                for (int c = 0; c < characters.Length; c++)
                {
                    if (c == curObjectNumber)
                    {
                        characters[c].SetActive(true);
                    }
                    else
                    {
                        characters[c].SetActive(false);
                    }
                }
                if (curObjectNumber == 0)
                {
                    caps[ProtectedPrefs.GetInt("Cap")].SetActive(true);
                    bear.SetActive(false);
                    jacket[0].SetActive(false);
                    jacket[1].SetActive(false);
                    belt[0].SetActive(false);
                    belt[1].SetActive(false);
                    belt[2].SetActive(false);
                    MaskAnonim.SetActive(false);
                    clothName.text = "Rifat";
                    Price.text     = "";
                    charId         = 0;
                    if (ProtectedPrefs.GetInt("Character1") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true);
                    }
                }
                else if (curObjectNumber == 1)
                {
                    caps[ProtectedPrefs.GetInt("Cap")].SetActive(true);
                    bear.SetActive(true);
                    jacket[0].SetActive(false);
                    jacket[1].SetActive(true);
                    belt[0].SetActive(true);
                    belt[1].SetActive(false);
                    belt[2].SetActive(false);
                    MaskAnonim.SetActive(false);
                    clothName.text = "Alim";
                    Price.text     = "170 000";
                    charId         = 1;

                    if (ProtectedPrefs.GetInt("Character2") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true);
                    }
                }
                else if (curObjectNumber == 2)
                {
                    caps[ProtectedPrefs.GetInt("Cap")].SetActive(true);
                    bear.SetActive(false);
                    jacket[0].SetActive(false);
                    jacket[1].SetActive(false);
                    belt[0].SetActive(false);
                    belt[1].SetActive(true);
                    belt[2].SetActive(false);
                    MaskAnonim.SetActive(false);
                    clothName.text = "Umar";
                    Price.text     = "1 250 000";
                    charId         = 2;

                    if (ProtectedPrefs.GetInt("Character3") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true);
                    }
                }
                else if (curObjectNumber == 3)
                {
                    caps[ProtectedPrefs.GetInt("Cap")].SetActive(true);
                    bear.SetActive(false);
                    ocular.SetActive(false);
                    jacket[0].SetActive(true);
                    jacket[1].SetActive(false);
                    belt[0].SetActive(false);
                    belt[1].SetActive(false);
                    belt[2].SetActive(true);
                    MaskAnonim.SetActive(true);
                    clothName.text = "Shamil'";
                    Price.text     = "600 000";
                    charId         = 3;

                    if (ProtectedPrefs.GetInt("Character4") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true);
                    }
                }

                if (curObjectNumber == 2 && ProtectedPrefs.GetInt("Cap") == 0)
                {
                    caps[0].SetActive(false);
                    capChar3.SetActive(true);
                }
                else
                {
                    capChar3.SetActive(false);
                }
            }

            if (!capSelect)
            {
                if (ProtectedPrefs.HasKey("Cap"))
                {
                    for (int i = 0; i < caps.Length; i++)
                    {
                        if (ProtectedPrefs.GetInt("Cap") == i)
                        {
                            if (i == 0 && curObjectNumber == 2 && charSelect)
                            {
                                capChar3.SetActive(true);
                                caps[i].SetActive(false);
                            }
                            else
                            {
                                capChar3.SetActive(false);
                                caps[i].SetActive(true);
                            }
                        }
                        else
                        {
                            caps[i].SetActive(false);
                        }
                    }
                }
            }
            else
            {
                if (curObjectNumber > caps.Length - 1)
                {
                    curObjectNumber = caps.Length - 1;
                }
                for (int cp = 0; cp < caps.Length; cp++)
                {
                    if (cp == curObjectNumber)
                    {
                        Price.text = (curObjectNumber + 1) * 35 + " 000";
                        if (cp == 0 && ProtectedPrefs.GetInt("Characters") == 2)
                        {
                            capChar3.SetActive(true);
                            caps[cp].SetActive(false);
                        }
                        else
                        {
                            capChar3.SetActive(false);
                            caps[cp].SetActive(true);
                        }
                    }
                    else
                    {
                        caps[cp].SetActive(false);
                    }
                }
                clothName.text = "Helmet " + (curObjectNumber + 1);
                capId          = curObjectNumber;

                switch (curObjectNumber)
                {
                case 0:
                    if (ProtectedPrefs.GetInt("Cap1") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true);
                    }
                    break;

                case 1:
                    if (ProtectedPrefs.GetInt("Cap2") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true);
                    }
                    break;

                case 2:
                    if (ProtectedPrefs.GetInt("Cap3") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true);
                    }
                    break;

                case 3:
                    if (ProtectedPrefs.GetInt("Cap4") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true);
                    }
                    break;
                }
            }

            if (!knifSelect)
            {
                if (ProtectedPrefs.HasKey("Knife"))
                {
                    for (int i = 0; i < knifes.Length; i++)
                    {
                        if (ProtectedPrefs.GetInt("Knife") == i)
                        {
                            knifes[ProtectedPrefs.GetInt("Knife")].SetActive(true);
                        }
                        else
                        {
                            knifes[i].SetActive(false);
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < knifes.Length; i++)
                    {
                        knifes[i].SetActive(false);
                    }
                }
            }
            else
            {
                if (curObjectNumber > knifes.Length - 1)
                {
                    curObjectNumber = knifes.Length - 1;
                }

                if (ProtectedPrefs.GetInt("Cap") == 0 && ProtectedPrefs.GetInt("Characters") == 2)
                {
                    capChar3.SetActive(true);
                    caps[0].SetActive(false);
                }
                else
                {
                    capChar3.SetActive(false);
                    caps[ProtectedPrefs.GetInt("Cap")].SetActive(true);
                }

                for (int cp = 0; cp < knifes.Length; cp++)
                {
                    Price.text = (curObjectNumber + 1) * 15 + " 000";
                    if (cp == curObjectNumber)
                    {
                        knifes[cp].SetActive(true);
                    }
                    else
                    {
                        knifes[cp].SetActive(false);
                    }
                    clothName.text = "Whinger " + (curObjectNumber + 1);
                    knifeId        = curObjectNumber;
                }

                switch (curObjectNumber)
                {
                case 0:
                    if (ProtectedPrefs.GetInt("Knife1") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true);
                    }
                    break;

                case 1:
                    if (ProtectedPrefs.GetInt("Knife2") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true);
                    }
                    break;

                case 2:
                    if (ProtectedPrefs.GetInt("Knife3") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true);
                    }
                    break;

                case 3:
                    if (ProtectedPrefs.GetInt("Knife4") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true);
                    }
                    break;

                case 4:
                    if (ProtectedPrefs.GetInt("Knife5") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true);
                    }
                    break;
                }
            }

            if (!otherSelect)
            {
                if (ProtectedPrefs.HasKey("Clock"))
                {
                    clock.SetActive(true);
                }
                else
                {
                    clock.SetActive(false);
                }
                if (ProtectedPrefs.HasKey("Ak47"))
                {
                    ak47.SetActive(true);
                }
                else
                {
                    ak47.SetActive(false);
                }
                if (ProtectedPrefs.HasKey("Oculus"))
                {
                    ocular.SetActive(true);
                }
                else
                {
                    ocular.SetActive(false);
                }
                SelectButtonText.text = "Select";
            }
            else
            {
                if (ProtectedPrefs.GetInt("Player") == 4)
                {
                    if (curObjectNumber > 1)
                    {
                        curObjectNumber = 1;
                    }
                }
                else
                {
                    if (curObjectNumber > 2)
                    {
                        curObjectNumber = 2;
                    }
                }

                if (curObjectNumber == 0)
                {
                    Price.text = "200 000";
                    if (ProtectedPrefs.GetInt("Clock1") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                        if (ProtectedPrefs.GetInt("ClockStart") == 1)
                        {
                            SelectButtonText.text = "Drop";
                            clock.SetActive(true);
                        }
                        else
                        {
                            SelectButtonText.text = "Select";
                            clock.SetActive(false);
                        }
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true); clock.SetActive(true);
                    }
                }
                else if (curObjectNumber == 1)
                {
                    Price.text = "1 500 000";
                    if (ProtectedPrefs.GetInt("Ak471") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                        if (ProtectedPrefs.GetInt("AkStart") == 1)
                        {
                            SelectButtonText.text = "Drop";
                            ak47.SetActive(true);
                        }
                        else
                        {
                            SelectButtonText.text = "Select";
                            ak47.SetActive(false);
                        }
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true); ak47.SetActive(true);
                    }
                }
                else if (curObjectNumber == 2)
                {
                    Price.text = "350 000";
                    if (ProtectedPrefs.GetInt("Oculus1") == 1)
                    {
                        selectBtn.SetActive(true); buyBtn.SetActive(false);
                        if (ProtectedPrefs.GetInt("SpectatesStart") == 1)
                        {
                            SelectButtonText.text = "Drop";
                            ocular.SetActive(true);
                        }
                        else
                        {
                            SelectButtonText.text = "Select";
                            ocular.SetActive(false);
                        }
                    }
                    else
                    {
                        selectBtn.SetActive(false); buyBtn.SetActive(true); ocular.SetActive(true);
                    }
                }

                if (ProtectedPrefs.GetInt("Cap") == 0 && ProtectedPrefs.GetInt("Characters") == 2)
                {
                    capChar3.SetActive(true);
                    caps[0].SetActive(false);
                }
                else
                {
                    capChar3.SetActive(false);
                    caps[ProtectedPrefs.GetInt("Cap")].SetActive(true);
                }

                if (0 == curObjectNumber)
                {
                    ak47.SetActive(false);
                    ocular.SetActive(false);
                    clothName.text = "Gold clock";
                }
                else if (1 == curObjectNumber)
                {
                    clock.SetActive(false);
                    ocular.SetActive(false);
                    clothName.text = "Premium gold AK-74";
                }
                else if (2 == curObjectNumber)
                {
                    clock.SetActive(false);
                    ak47.SetActive(false);
                    clothName.text = "Gold sunglasses";
                }
            }


            //******************************************************//
        }

        //if (ProtectedPrefs.GetInt("Character4") == 1) { ocular.SetActive(false); }
    }
Beispiel #22
0
 public void BuyBtn()
 {
     if (charSelect)
     {
         if (charId == 1 && ProtectedPrefs.GetInt("Coins") >= 170000)
         {
             ProtectedPrefs.SetInt("Character2", 1);
             ProtectedPrefs.SetInt("Coins", (ProtectedPrefs.GetInt("Coins") - 170000));
             animationManager.animationState = animationManager.Select;
         }
         else if (charId == 2 && ProtectedPrefs.GetInt("Coins") >= 1250000)
         {
             ProtectedPrefs.SetInt("Character3", 1);
             ProtectedPrefs.SetInt("Coins", (ProtectedPrefs.GetInt("Coins") - 1250000));
             animationManager.animationState = animationManager.Select;
         }
         else if (charId == 3 && ProtectedPrefs.GetInt("Coins") >= 600000)
         {
             ProtectedPrefs.SetInt("Character4", 1);
             ProtectedPrefs.SetInt("Coins", (ProtectedPrefs.GetInt("Coins") - 600000));
             animationManager.animationState = animationManager.Select;
         }
     }
     if (capSelect)
     {
         if (capId == 1 && ProtectedPrefs.GetInt("Coins") >= 70000)
         {
             ProtectedPrefs.SetInt("Cap2", 1);
             ProtectedPrefs.SetInt("Coins", (ProtectedPrefs.GetInt("Coins") - 70000));
             animationManager.animationState = animationManager.Select;
         }
         else if (capId == 2 && ProtectedPrefs.GetInt("Coins") >= 105000)
         {
             ProtectedPrefs.SetInt("Cap3", 1);
             ProtectedPrefs.SetInt("Coins", (ProtectedPrefs.GetInt("Coins") - 105000));
             animationManager.animationState = animationManager.Select;
         }
         else if (capId == 3 && ProtectedPrefs.GetInt("Coins") >= 140000)
         {
             ProtectedPrefs.SetInt("Cap4", 1);
             ProtectedPrefs.SetInt("Coins", (ProtectedPrefs.GetInt("Coins") - 140000));
             animationManager.animationState = animationManager.Select;
         }
     }
     if (knifSelect)
     {
         if (knifeId == 0 && ProtectedPrefs.GetInt("Coins") >= 15000)
         {
             ProtectedPrefs.SetInt("Knife1", 1);
             ProtectedPrefs.SetInt("Coins", (ProtectedPrefs.GetInt("Coins") - 15000));
             ProtectedPrefs.SetInt("mLamp", ProtectedPrefs.GetInt("mLamp") + 3);
             animationManager.animationState = animationManager.Select;
         }
         else if (knifeId == 1 && ProtectedPrefs.GetInt("Coins") >= 30000)
         {
             ProtectedPrefs.SetInt("Knife2", 1);
             ProtectedPrefs.SetInt("Coins", (ProtectedPrefs.GetInt("Coins") - 30000));
             ProtectedPrefs.SetInt("mLamp", ProtectedPrefs.GetInt("mLamp") + 4);
             animationManager.animationState = animationManager.Select;
         }
         else if (knifeId == 2 && ProtectedPrefs.GetInt("Coins") >= 45000)
         {
             ProtectedPrefs.SetInt("Knife3", 1);
             ProtectedPrefs.SetInt("Coins", (ProtectedPrefs.GetInt("Coins") - 45000));
             ProtectedPrefs.SetInt("mLamp", ProtectedPrefs.GetInt("mLamp") + 5);
             animationManager.animationState = animationManager.Select;
         }
         else if (knifeId == 3 && ProtectedPrefs.GetInt("Coins") >= 60000)
         {
             ProtectedPrefs.SetInt("Knife4", 1);
             ProtectedPrefs.SetInt("Coins", (ProtectedPrefs.GetInt("Coins") - 60000));
             ProtectedPrefs.SetInt("mLamp", ProtectedPrefs.GetInt("mLamp") + 6);
             animationManager.animationState = animationManager.Select;
         }
         else if (knifeId == 4 && ProtectedPrefs.GetInt("Coins") >= 75000)
         {
             ProtectedPrefs.SetInt("Knife5", 1);
             ProtectedPrefs.SetInt("Coins", (ProtectedPrefs.GetInt("Coins") - 75000));
             ProtectedPrefs.SetInt("mLamp", ProtectedPrefs.GetInt("mLamp") + 7);
             animationManager.animationState = animationManager.Select;
         }
     }
     if (otherSelect)
     {
         if (curObjectNumber == 0 && ProtectedPrefs.GetInt("Coins") >= 200000)
         {
             ProtectedPrefs.SetInt("Clock1", 1);
             ProtectedPrefs.SetInt("Coins", (ProtectedPrefs.GetInt("Coins") - 200000));
             ProtectedPrefs.SetInt("ClockStart", 1);
             animationManager.animationState = animationManager.Select;
         }
         else if (curObjectNumber == 1 && ProtectedPrefs.GetInt("Coins") >= 1500000)
         {
             ProtectedPrefs.SetInt("Ak471", 1);
             ProtectedPrefs.SetInt("Coins", (ProtectedPrefs.GetInt("Coins") - 1500000));
             ProtectedPrefs.SetInt("AkStart", 1);
             animationManager.animationState = animationManager.Select;
         }
         else if (curObjectNumber == 2 && ProtectedPrefs.GetInt("Coins") >= 350000)
         {
             ProtectedPrefs.SetInt("Oculus1", 1);
             ProtectedPrefs.SetInt("Coins", (ProtectedPrefs.GetInt("Coins") - 350000));
             ProtectedPrefs.SetInt("SpectatesStart", 1);
             animationManager.animationState = animationManager.Select;
         }
     }
 }
Beispiel #23
0
    void OnTriggerEnter(Collider items)
    {
        if (items.gameObject.tag == "Coin")
        {
            Instantiate(prefCoinDie, new Vector3(transform.position.x + 1.5f, transform.position.y + 13F, transform.position.z + 5F), transform.rotation);
            if (!doubleCoin)
            {
                GameControll.coin++;
            }
            else
            {
                GameControll.coin = GameControll.coin + 2;
            }
            AudiosManager.instance.PlayingSound("Coin");
            Destroy(items.gameObject);
        }
        if (items.gameObject.tag == "Magnet")
        {
            Instantiate(prefmagnetDie, new Vector3(transform.position.x, transform.position.y + 2F, transform.position.z + 15F), transform.rotation);
            if (Controller.iMagnet)
            {
                Controller.cM = Controller.cM - Controller.magnetTime;
            }
            else
            {
                Controller.iMagnet = true;
                mg();
            }
            AudiosManager.instance.PlayingSound("Power");
            Destroy(items.gameObject);
        }
        else if (items.gameObject.tag == "Kover")
        {
            if (Controller.iFly)
            {
                Controller.cF = Controller.cF - Controller.flyTime;
            }
            else
            {
                Controller.iFly = true;
                kv();
            }
            AudiosManager.instance.PlayingSound("Power");
            Destroy(items.gameObject);
        }
        else if (items.gameObject.tag == "Bots")
        {
            Instantiate(preftapDie, new Vector3(transform.position.x, transform.position.y + 2F, transform.position.z + 15F), transform.rotation);
            if (Controller.doubleJump)
            {
                Controller.cJ = Controller.cJ - Controller.doubleJumpTime;
            }
            else
            {
                Controller.doubleJump = true;
                bt();
            }
            AudiosManager.instance.PlayingSound("Power");
            Destroy(items.gameObject);
        }
        else if (items.gameObject.tag == "Star")
        {
            Instantiate(prefdoubleDie, new Vector3(transform.position.x, transform.position.y + 2F, transform.position.z + 15F), transform.rotation);
            if (doubleCoin)
            {
                cointimer = cointimer - Controller.doubleCoinTime;
            }
            else
            {
                doubleCoin = true;
                dc();
            }
            AudiosManager.instance.PlayingSound("Power");
            Destroy(items.gameObject);
        }

        else if (items.gameObject.tag == "Book")
        {
            itemEffectMaterial.mainTexture = bookEffectIco;
            GameObject effect = Instantiate(itemEffectObject, new Vector3(transform.position.x, transform.position.y + 7.5F, transform.position.z - 7F), transform.rotation) as GameObject;
            effect.transform.SetParent(this.transform);

            ProtectedPrefs.SetInt("mBook", ProtectedPrefs.GetInt("mBook") + 1);
            AudiosManager.instance.PlayingSound("Power");
            Destroy(items.gameObject);
        }
        else if (items.gameObject.tag == "Pipe")
        {
            itemEffectMaterial.mainTexture = pipeEffectIco;
            GameObject effect = Instantiate(itemEffectObject, new Vector3(transform.position.x, transform.position.y + 7.5F, transform.position.z - 7F), transform.rotation) as GameObject;
            effect.transform.SetParent(this.transform);

            ProtectedPrefs.SetInt("mPipe", ProtectedPrefs.GetInt("mPipe") + 1);
            AudiosManager.instance.PlayingSound("Power");
            Destroy(items.gameObject);
        }
        else if (items.gameObject.tag == "Emerald")
        {
            itemEffectMaterial.mainTexture = emeraldEffectIco;
            GameObject effect = Instantiate(itemEffectObject, new Vector3(transform.position.x, transform.position.y + 7.5F, transform.position.z - 7F), transform.rotation) as GameObject;
            effect.transform.SetParent(this.transform);

            ProtectedPrefs.SetInt("mEmerald", ProtectedPrefs.GetInt("mEmerald") + 1);
            AudiosManager.instance.PlayingSound("Power");
            Destroy(items.gameObject);
        }
        else if (items.gameObject.tag == "Gold")
        {
            itemEffectMaterial.mainTexture = goldEffectIco;
            GameObject effect = Instantiate(itemEffectObject, new Vector3(transform.position.x, transform.position.y + 7.5F, transform.position.z - 7F), transform.rotation) as GameObject;
            effect.transform.SetParent(this.transform);

            ProtectedPrefs.SetInt("mGold", ProtectedPrefs.GetInt("mGold") + 1);
            AudiosManager.instance.PlayingSound("Power");
            Destroy(items.gameObject);
        }
        else if (items.gameObject.tag == "Kalyan")
        {
            itemEffectMaterial.mainTexture = kalyanEffectIco;
            GameObject effect = Instantiate(itemEffectObject, new Vector3(transform.position.x, transform.position.y + 7.5F, transform.position.z - 7F), transform.rotation) as GameObject;
            effect.transform.SetParent(this.transform);

            ProtectedPrefs.SetInt("mKalyan", ProtectedPrefs.GetInt("mKalyan") + 1);
            AudiosManager.instance.PlayingSound("Power");
            Destroy(items.gameObject);
        }
        else if (items.gameObject.tag == "Lamp")
        {
            itemEffectMaterial.mainTexture = lampEffectIco;
            GameObject effect = Instantiate(itemEffectObject, new Vector3(transform.position.x, transform.position.y + 7.5F, transform.position.z - 7F), transform.rotation) as GameObject;
            effect.transform.SetParent(this.transform);

            ProtectedPrefs.SetInt("mLamp", ProtectedPrefs.GetInt("mLamp") + 1);
            AudiosManager.instance.PlayingSound("Power");
            Destroy(items.gameObject);
            getLamp = true;
        }
        else if (items.gameObject.tag == "Rubin")
        {
            itemEffectMaterial.mainTexture = rubinEffectIco;
            GameObject effect = Instantiate(itemEffectObject, new Vector3(transform.position.x, transform.position.y + 7.5F, transform.position.z - 7F), transform.rotation) as GameObject;
            effect.transform.SetParent(this.transform);

            ProtectedPrefs.SetInt("mRubin", ProtectedPrefs.GetInt("mRubin") + 1);
            AudiosManager.instance.PlayingSound("Power");
            Destroy(items.gameObject);
        }
        else if (items.gameObject.tag == "Urna")
        {
            itemEffectMaterial.mainTexture = urnEffectIco;
            GameObject effect = Instantiate(itemEffectObject, new Vector3(transform.position.x, transform.position.y + 7.5F, transform.position.z - 7F), transform.rotation) as GameObject;
            effect.transform.SetParent(this.transform);

            ProtectedPrefs.SetInt("mUrna", ProtectedPrefs.GetInt("mUrna") + 1);
            AudiosManager.instance.PlayingSound("Power");
            Destroy(items.gameObject);
        }
        else if (items.gameObject.tag == "Vaza")
        {
            itemEffectMaterial.mainTexture = vazeEffectIco;
            GameObject effect = Instantiate(itemEffectObject, new Vector3(transform.position.x, transform.position.y + 7.5F, transform.position.z - 7F), transform.rotation) as GameObject;
            effect.transform.SetParent(this.transform);

            ProtectedPrefs.SetInt("mVaza", ProtectedPrefs.GetInt("mVaza") + 1);
            AudiosManager.instance.PlayingSound("Power");
            Destroy(items.gameObject);
        }
    }
Beispiel #24
0
    void Update()
    {
        if (lifesave == true && Controller.iDie && !loadS && !SaveMe)
        {
            showAd = false;
            SaveLifePanel.SetActive(true);
            timerl        += Time.deltaTime;
            sl.fillAmount -= Time.deltaTime / 1.8F;
            if (timerl >= 1.8F)
            {
                timerl        = 0;
                sl.fillAmount = 1;
                SaveLifePanel.SetActive(false);
                Invoke("GameOver", 0.5f);
                loadS = true;
            }
        }

        if (itemAbsorb.getLamp)
        {
            GetLamp();
        }
        coine.text    = coin.ToString();
        distance.text = Controller.Distance.ToString("00000000") + "0";
        if (Controller.Distance > 10 && Controller.Distance > ProtectedPrefs.GetFloat("HighScore") && !changeScorecolor)
        {
            cc += Time.deltaTime;
            if (cc < 1)
            {
                distance.color = new Color(1, 0, 0, 1);
            }
            else if (cc > 1 && cc < 1.5f)
            {
                distance.color = new Color(1, 1, 1, 1);
            }
            else if (cc > 1.5f && cc < 2)
            {
                distance.color = new Color(1, 0, 0, 1);
            }
            else if (cc > 2 && cc < 2.5f)
            {
                distance.color = new Color(1, 1, 1, 1);
            }
            else if (cc > 2.5f)
            {
                distance.color   = new Color(1f, 0.92f, 0.016f, 1f);
                cc               = 0;
                changeScorecolor = true;
            }
        }
        if (Controller.iDie && ProtectedPrefs.GetInt("mLamp") < 1)
        {
            MainMenuPanel.SetActive(false);
            Invoke("GameOver", 0.5f);
        }
        else if (Controller.iDie && ProtectedPrefs.GetInt("mLamp") > 0 && !lifesave)
        {
            MainMenuPanel.SetActive(false);
            lifesave = true;
            loadS    = false;
        }
    }
    public void Customize()
    {
        if (ProtectedPrefs.GetInt("Player") == 1)
        {
            characters[0].SetActive(true);
            characters[1].SetActive(false);
            characters[2].SetActive(false);
            characters[3].SetActive(false);
            bear.SetActive(false);
            jacket[0].SetActive(false);
            jacket[1].SetActive(false);
            belt[0].SetActive(false);
            belt[1].SetActive(false);
            belt[2].SetActive(false);
            MaskAnonim.SetActive(false);
        }
        else if (ProtectedPrefs.GetInt("Player") == 2)
        {
            characters[0].SetActive(false);
            characters[1].SetActive(true);
            characters[2].SetActive(false);
            characters[3].SetActive(false);
            bear.SetActive(true);
            jacket[0].SetActive(false);
            jacket[1].SetActive(true);
            belt[0].SetActive(true);
            belt[1].SetActive(false);
            belt[2].SetActive(false);
            MaskAnonim.SetActive(false);
        }
        else if (ProtectedPrefs.GetInt("Player") == 3)
        {
            characters[0].SetActive(false);
            characters[1].SetActive(false);
            characters[2].SetActive(true);
            characters[3].SetActive(false);
            bear.SetActive(false);
            jacket[0].SetActive(false);
            jacket[1].SetActive(false);
            belt[0].SetActive(false);
            belt[1].SetActive(true);
            belt[2].SetActive(false);
            MaskAnonim.SetActive(false);
        }
        else if (ProtectedPrefs.GetInt("Player") == 4)
        {
            characters[0].SetActive(false);
            characters[1].SetActive(false);
            characters[2].SetActive(false);
            characters[3].SetActive(true);
            bear.SetActive(false);
            jacket[0].SetActive(true);
            jacket[1].SetActive(false);
            belt[0].SetActive(false);
            belt[1].SetActive(false);
            belt[2].SetActive(true);
            MaskAnonim.SetActive(true);
            ocular.SetActive(false);
        }
        else
        {
            characters[0].SetActive(true);
            characters[1].SetActive(false);
            characters[2].SetActive(false);
            characters[3].SetActive(false);
            bear.SetActive(false);
            jacket[0].SetActive(false);
            jacket[1].SetActive(false);
            belt[0].SetActive(false);
            belt[1].SetActive(false);
            belt[2].SetActive(false);
            MaskAnonim.SetActive(false);
        }

        if (ProtectedPrefs.GetInt("Helmet") == 1)
        {
            if (ProtectedPrefs.GetInt("Player") != 3)
            {
                caps[0].SetActive(true);
                caps[1].SetActive(false);
                caps[2].SetActive(false);
                caps[3].SetActive(false);
                capChar3.SetActive(false);
            }
            else
            {
                caps[0].SetActive(false);
                caps[1].SetActive(false);
                caps[2].SetActive(false);
                caps[3].SetActive(false);
                capChar3.SetActive(true);
            }
        }
        else if (ProtectedPrefs.GetInt("Helmet") == 2)
        {
            caps[0].SetActive(false);
            caps[1].SetActive(true);
            caps[2].SetActive(false);
            caps[3].SetActive(false);
            capChar3.SetActive(false);
        }
        else if (ProtectedPrefs.GetInt("Helmet") == 3)
        {
            caps[0].SetActive(false);
            caps[1].SetActive(false);
            caps[2].SetActive(true);
            caps[3].SetActive(false);
            capChar3.SetActive(false);
        }
        else if (ProtectedPrefs.GetInt("Helmet") == 4)
        {
            caps[0].SetActive(false);
            caps[1].SetActive(false);
            caps[2].SetActive(false);
            caps[3].SetActive(true);
            capChar3.SetActive(false);
        }
        else
        {
            if (ProtectedPrefs.GetInt("Player") != 3)
            {
                caps[0].SetActive(true);
                caps[1].SetActive(false);
                caps[2].SetActive(false);
                caps[3].SetActive(false);
                capChar3.SetActive(false);
            }
            else
            {
                caps[0].SetActive(false);
                caps[1].SetActive(false);
                caps[2].SetActive(false);
                caps[3].SetActive(false);
                capChar3.SetActive(true);
            }
        }

        if (ProtectedPrefs.GetInt("Whinger") == 1)
        {
            knifes[0].SetActive(true);
            knifes[1].SetActive(false);
            knifes[2].SetActive(false);
            knifes[3].SetActive(false);
            knifes[4].SetActive(false);
        }
        else if (ProtectedPrefs.GetInt("Whinger") == 2)
        {
            knifes[0].SetActive(false);
            knifes[1].SetActive(true);
            knifes[2].SetActive(false);
            knifes[3].SetActive(false);
            knifes[4].SetActive(false);
        }
        else if (ProtectedPrefs.GetInt("Whinger") == 3)
        {
            knifes[0].SetActive(false);
            knifes[1].SetActive(false);
            knifes[2].SetActive(true);
            knifes[3].SetActive(false);
            knifes[4].SetActive(false);
        }
        else if (ProtectedPrefs.GetInt("Whinger") == 4)
        {
            knifes[0].SetActive(false);
            knifes[1].SetActive(false);
            knifes[2].SetActive(false);
            knifes[3].SetActive(true);
            knifes[4].SetActive(false);
        }
        else if (ProtectedPrefs.GetInt("Whinger") == 5)
        {
            knifes[0].SetActive(false);
            knifes[1].SetActive(false);
            knifes[2].SetActive(false);
            knifes[3].SetActive(false);
            knifes[4].SetActive(true);
        }
        else
        {
            knifes[0].SetActive(false);
            knifes[1].SetActive(false);
            knifes[2].SetActive(false);
            knifes[3].SetActive(false);
            knifes[4].SetActive(false);
        }

        if (ProtectedPrefs.GetInt("ClockStart") == 1)
        {
            clock.SetActive(true);
        }
        else
        {
            clock.SetActive(false);
        }

        if (ProtectedPrefs.GetInt("AkStart") == 1)
        {
            ak47.SetActive(true);
        }
        else
        {
            ak47.SetActive(false);
        }

        if (ProtectedPrefs.GetInt("SpectatesStart") == 1 && ProtectedPrefs.GetInt("Player") != 4)
        {
            ocular.SetActive(true);
        }
        else
        {
            ocular.SetActive(false);
        }
    }
    void Start()
    {
        bc = ProtectedPrefs.GetInt("mBook");
        pc = ProtectedPrefs.GetInt("mPipe");
        ec = ProtectedPrefs.GetInt("mEmerald");
        gc = ProtectedPrefs.GetInt("mGold");
        kc = ProtectedPrefs.GetInt("mKalyan");
        rc = ProtectedPrefs.GetInt("mRubin");
        uc = ProtectedPrefs.GetInt("mUrna");
        vc = ProtectedPrefs.GetInt("mVaza");

        if (bc >= 230)
        {
            book.text = "compleit";
            if (ProtectedPrefs.GetInt("mb") == 0)
            {
                ProtectedPrefs.SetInt("mb", 1);
                ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") + 10000);
            }
        }
        else
        {
            book.text = ProtectedPrefs.GetInt("mBook").ToString() + " / 230";
        }

        if (pc >= 300)
        {
            pipe.text = "compleit";
            if (ProtectedPrefs.GetInt("mp") == 0)
            {
                ProtectedPrefs.SetInt("mp", 1);
                ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") + 15000);
            }
        }
        else
        {
            pipe.text = ProtectedPrefs.GetInt("mPipe").ToString() + " / 300";
        }

        if (ec >= 350)
        {
            emerald.text = "compleit";
            if (ProtectedPrefs.GetInt("me") == 0)
            {
                ProtectedPrefs.SetInt("me", 1);
                ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") + 25000);
            }
        }
        else
        {
            emerald.text = ProtectedPrefs.GetInt("mEmerald").ToString() + " / 350";
        }

        if (gc >= 500)
        {
            gold.text = "compleit";
            if (ProtectedPrefs.GetInt("mg") == 0)
            {
                ProtectedPrefs.SetInt("mg", 1);
                ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") + 50000);
            }
        }
        else
        {
            gold.text = ProtectedPrefs.GetInt("mGold").ToString() + " / 500";
        }

        if (kc >= 550)
        {
            kalyan.text = "compleit";
            if (ProtectedPrefs.GetInt("mk") == 0)
            {
                ProtectedPrefs.SetInt("mk", 1);
                ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") + 70000);
            }
        }
        else
        {
            kalyan.text = ProtectedPrefs.GetInt("mKalyan").ToString() + " / 550";
        }

        if (rc >= 650)
        {
            rubine.text = "compleit";
            if (ProtectedPrefs.GetInt("mr") == 0)
            {
                ProtectedPrefs.SetInt("mr", 1);
                ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") + 100000);
            }
        }
        else
        {
            rubine.text = ProtectedPrefs.GetInt("mRubin").ToString() + " / 650";
        }

        if (uc >= 750)
        {
            urna.text = "compleit";
            if (ProtectedPrefs.GetInt("mu") == 0)
            {
                ProtectedPrefs.SetInt("mu", 1);
                ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") + 180000);
            }
        }
        else
        {
            urna.text = ProtectedPrefs.GetInt("mUrna").ToString() + " / 750";
        }

        if (vc >= 800)
        {
            vaze.text = "compleit";
            if (ProtectedPrefs.GetInt("mv") == 0)
            {
                ProtectedPrefs.SetInt("mv", 1);
                ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") + 250000);
            }
        }
        else
        {
            vaze.text = ProtectedPrefs.GetInt("mVaza").ToString() + " / 800";
        }

        if (ProtectedPrefs.GetInt("Coins") >= 500000)
        {
            coincollect.text = "compleit";
            if (ProtectedPrefs.GetInt("cc") == 0)
            {
                ProtectedPrefs.SetInt("cc", 1);
                ProtectedPrefs.SetInt("Coins", ProtectedPrefs.GetInt("Coins") + 350000);
            }
        }
        else
        {
            coincollect.text = "none";
        }
    }