Пример #1
0
    private void Start()
    {
        GS        = Instantiate(GameSoundObject, new Vector3(0f, 0f, 0f), Quaternion.identity);
        GameAudio = GS.GetComponent <AudioSource>();
        DontDestroyOnLoad(GS);
        if (PlayerPrefs.GetInt("MUSIC", 1) == 1)
        {
            MusicToggle.TurnOn();
            GameAudio.Play();
        }
        else
        {
            MusicToggle.TurnOff();
            GameAudio.Stop();
        }

        string quality = PlayerPrefs.GetString("QS", "High");

        string[] names = QualitySettings.names;
        Debug.Log(quality);
        for (int i = 0; i < names.Length; i++)
        {
            if (names[i] == quality)
            {
                RadioButtons[i].GetComponent <LeanToggle>().TurnOn();
                RadioButtons[i].GetComponent <LeanButton>().interactable = false;
                QualitySettings.SetQualityLevel(i, true);
            }
        }
    }
Пример #2
0
    void Start()
    {
        gametype = GS.GetComponent <gameSelected> ().getGameState();

        tip1 = (int)(Mathf.Abs(Random.Range(1.0f, 10.0f)));
        tip2 = (int)(Mathf.Abs(Random.Range(1.0f, 10.0f)));

        if (gametype == 1)
        {
            //Addition Tip

            tipanswer     = tip1 + tip2;
            pauseTip.text = "Addition example : " + tip1 + " + __ = " + tipanswer + ";  Answer is " + tip2;
        }
        else if (gametype == 2)
        {
            //Subtraction Tip

            tipanswer     = tip1 + tip2;
            pauseTip.text = "Subtraction example : " + tipanswer + " - __ = " + tip1 + ";  Answer is " + tip2;
        }
        else if (gametype == 3)
        {
            //Multiplication Tip

            tipanswer     = tip1 * tip2;
            pauseTip.text = "Multiplication example : " + tip1 + " X __ = " + tipanswer + ";  Answer is " + tip2;
        }
        else if (gametype == 4)
        {
            //Division Tip

            tipanswer     = tip1 * tip2;
            pauseTip.text = "Division example : " + tipanswer + " / __ = " + tip1 + ";  Answer is " + tip2;
        }

        activeTiles  = new List <GameObject> ();
        activeTiles2 = new List <GameObject> ();

        playerTransform = GameObject.FindGameObjectWithTag("Player").transform;

        GenerateEmpties();
    }