示例#1
0
    // Use this for initialization
    void Start()
    {
        Positive = true;
        StageSetUp.SetActive(true);
        Check1    = 0;
        Finish    = false;
        Lives     = PlayerPrefs.GetInt("PLives");
        Score     = PlayerPrefs.GetInt("PScore");
        Win       = PlayerPrefs.GetInt("Result");
        timecheck = -1;

        if (Win == 1)
        {
            Score++;
            PlayerPrefs.SetInt("PScore", Score);
        }
        else if (Win == 0)
        {
            Lives--;
            PlayerPrefs.SetInt("PLives", Lives);
        }

        if (Lives != 3 || Score != 0)
        {
            if (Win == 1)
            {
                Success.Play();
            }
            else
            {
                Fail.Play();
            }
        }

        if (Score == 20)
        {
            Finish = true;
        }
        if (Lives == 0)
        {
            NextGame = "LoseScreen";
            SceneManager.LoadScene(NextGame);
        }

        if (Score >= 15)
        {
            PlayerPrefs.SetInt("CurrentSets", 4);
            PlayerPrefs.SetFloat("PTime", 3.5f);
        }
        else if (Score >= 10)
        {
            PlayerPrefs.SetInt("CurrentSets", 3);
            PlayerPrefs.SetFloat("PTime", 4.5f);
        }
        else if (Score >= 5)
        {
            PlayerPrefs.SetInt("CurrentSets", 2);
            PlayerPrefs.SetFloat("PTime", 5.5f);
        }

        T = PlayerPrefs.GetFloat("PTime");

        if (Finish == true)
        {
            Up.GetComponent <SpriteRenderer>().enabled   = true;
            Down.GetComponent <SpriteRenderer>().enabled = false;
            CurtainGood.Play();
            Positive = true;
            NextGame = "VoteGame";
        }

        else if (Lives == 0)
        {
            Up.GetComponent <SpriteRenderer>().enabled   = false;
            Down.GetComponent <SpriteRenderer>().enabled = true;
            CurtainBad.Play();
            Positive = false;
            NextGame = "LoseScreen";
        }

        else
        {
            rvalue2 = RandomValue();
            PlayerPrefs.SetInt("CurrentGame", rvalue2);
            if (rvalue2 <= 7)
            {
                Up.GetComponent <SpriteRenderer>().enabled   = true;
                Down.GetComponent <SpriteRenderer>().enabled = false;
                CurtainGood.Play();
                Positive = true;
            }
            else
            {
                Up.GetComponent <SpriteRenderer>().enabled   = false;
                Down.GetComponent <SpriteRenderer>().enabled = true;
                CurtainBad.Play();
                Positive = false;
            }
            if (rvalue2 == 0)
            {
                NextGame = "GolfAnimatedGame";
                //  RuleText.text = "DUMP RESORT: TAP at the right moment";
            }
            else if (rvalue2 == 1)
            {
                NextGame = "TextGame1";
                //  RuleText.text = "COVFEFE: TAP the correct letters";
            }
            else if (rvalue2 == 2)
            {
                NextGame = "SodaGame";
                //   RuleText.text = "CHUG DIET SODA: CLICK and HOLD soda";
            }

            else if (rvalue2 == 3)
            {
                NextGame = "WallGame";
                //  RuleText.text = "BUILD THE WALL: TAP to place missing bricks";
            }
            else if (rvalue2 == 4)
            {
                NextGame = "GrabCatGame";
                //  RuleText.text = "GRAB THE PUSSY: TAP to grab the pussy";
            }

            else if (rvalue2 == 5)
            {
                NextGame = "SteakGame";
                //  RuleText.text = "SHAKE THE KETCHUP! CLICk and DRAG to prepare your meal";
            }
            else if (rvalue2 == 6)
            {
                NextGame = "ButinGame";
                //  RuleText.text = "PROTECT BUTIN: CLICK to hide Butin";
            }

            else if (rvalue2 == 7)
            {
                NextGame = "CombGame";
                //  RuleText.text = "READY THE NUKES: TAP the keys in time";
            }

            else if (rvalue2 == 8)
            {
                NextGame = "GrabWomanGame";
                //   RuleText.text = "GRAB THE PUSSY: TAP to grab the pussy";
            }
            else if (rvalue2 == 9)
            {
                NextGame = "EarthGame";
                //  RuleText.text = "CLICK THE USA to exit the Paris agreement";
            }
            else if (rvalue2 == 10)
            {
                NextGame = "PipeGame";
                //  RuleText.text = "Drag the pipes to the pipeline";
            }
            else if (rvalue2 == 11)
            {
                NextGame = "MoneyGame";
                //    RuleText.text = "P**N STAR HUSH MONEY: CLICK and DRAG only 130,000 dollars";
            }
            else if (rvalue2 == 12)
            {
                NextGame = "ImmigrantsGame";
                //   RuleText.text = "KEEP THOSE IMMIGRANTS OUT!: TAP on the immigrant";
            }

            else if (rvalue2 == 13)
            {
                NextGame = "AirportGame";
                //   RuleText.text = "KEEP THOSE MUSLIMS OUT!: TAP on the muslim";
            }

            else if (rvalue2 == 14)
            {
                NextGame = "KeyGame";
                //  RuleText.text = "READY THE NUKES: TAP the keys in time";
            }
        }
    }