Example #1
0
    void Update()
    {
        if (life <= 0)
        {
            lose      = true;
            Life.text = "0";
            restart.SetActive(true);

            n = ScoreChange.score;
            if (n > StartProg.MaxScore)
            {
                StartProg.MaxScore = n;
            }

            if (StartProg.Life >= 7)
            {
                StartProg.Life = 7;
            }
            //LifeChange.life = StartProg.Life;

            StartProg.Money += n / 2;
            StartProg.ReStore();
            ScoreChange.score = 0;
        }
        else
        {
            Life.text = life.ToString();
            //gameObject.GetComponent<Text> ().text = life.ToString ();
        }
    }
Example #2
0
    void OnMouseUpAsButton()
    {
        SceneManager.LoadScene("Game_1");
        LifeChange.lose = false;
        //LifeChange.life = StartProg.TLife;

        if (StartProg.Life >= 7)
        {
            StartProg.Life = 7;
        }
        if (StartProg.TLife > 7)
        {
            StartProg.Life  = StartProg.TLife;
            StartProg.TLife = 7;
        }
        LifeChange.life = StartProg.Life;
        n = ScoreChange.score;
        if (n > StartProg.MaxScore)
        {
            StartProg.MaxScore = n;
            //StartProg.ReStore ();
        }

        StartProg.Money += n / 2;
        StartProg.ReStore();
        ScoreChange.score = 0;
        ScoreChange.n     = 4;
        //WaitForSeconds (2f);
    }
Example #3
0
 void OnMouseUpAsButton()
 {
     if (StartProg.Bomb >= 1 && LifeChange.lose == false && Timeb == true)
     {
         StartProg.Bomb--;
         StartProg.ReStore();
         MoveBubble.bomb = true;
         time            = 0.5f; Timeb = false;
         NoAct           = 5f;
     }
 }
Example #4
0
 void OnMouseUpAsButton()
 {
     if (StartProg.X2Money >= 1 && LifeChange.lose == false && Timeb == true)
     {
         StartProg.X2Money--;
         StartProg.ReStore();
         SpawnBubble.rand = 5;
         time             = 15; Timeb = false;
         NoAct            = 5f;
     }
 }
Example #5
0
 void OnMouseUpAsButton()
 {
     if (StartProg.Frozi >= 1 && LifeChange.lose == false && Timeb == true)
     {
         StartProg.Frozi--;
         StartProg.ReStore();
         MoveBubble.fallSpeed   /= 2;
         SpawnBubble.SpeedSpawn += 0.1f;
         time = 1f; Timeb = false;
     }
 }
Example #6
0
 void OnMouseDown()
 {
     StartProg.Money += 10;
     StartProg.ReStore();
     Destroy(gameObject);
 }
Example #7
0
 void OnMouseUp()
 {
     StartProg.Money += 10000;
     StartProg.ReStore();
 }
Example #8
0
    //public static int life = 3;

    void OnMouseUpAsButton()
    {
        switch (gameObject.name)
        {
        case "Bomb":
            n = StartProg.Money;
            if (n >= 200)
            {
                StartProg.Bomb++;
                n -= 200;
                StartProg.Money = n;
                StartProg.ReStore();
            }
            break;

        case "X2Money":
            n = StartProg.Money;
            if (n >= 100)
            {
                StartProg.X2Money++;
                n -= 100;
                StartProg.Money = n;
                StartProg.ReStore();
            }
            break;

        case "Frozi":
            n = StartProg.Money;
            if (n >= 50)
            {
                StartProg.Frozi++;
                n -= 50;
                StartProg.Money = n;
                StartProg.ReStore();
            }
            break;

        case "Heart":
            n = StartProg.Money;
            if ((n >= 150))
            {
                StartProg.Life++;
                StartProg.TLife = StartProg.Life;
                n -= 150;
                StartProg.Money = n;
                StartProg.ReStore();
            }
            break;

        case "Fon":
            SceneManager.LoadScene("MagazFon");
            break;

        case "Fon1":
            Fon.NFon = 0;
            break;

        case "Fon2":
            Fon.NFon = 1;
            break;
        }
    }