Example #1
0
    // Use this for initialization
    void Start()
    {
        currentplayer = PlayerPrefs.GetString("CurrentPlayer");
        GS            = GetComponent <gameSelected> ();

        addscore.text      = "Highscore : " + ((int)PlayerPrefs.GetFloat(currentplayer + "_Addscore"));
        subtractscore.text = "Highscore : " + ((int)PlayerPrefs.GetFloat(currentplayer + "_Subtractscore"));
        multiplyscore.text = "Highscore : " + ((int)PlayerPrefs.GetFloat(currentplayer + "_Multiplicationscore"));
        dividescore.text   = "Highscore : " + ((int)PlayerPrefs.GetFloat(currentplayer + "_Divisionscore"));

        addexperience      = ((int)PlayerPrefs.GetFloat(currentplayer + "_Addexp"));
        subtractexperience = ((int)PlayerPrefs.GetFloat(currentplayer + "_Subtractexp"));
        multiplyexperience = ((int)PlayerPrefs.GetFloat(currentplayer + "_Multiplicationexp"));
        divideexperience   = ((int)PlayerPrefs.GetFloat(currentplayer + "_Divisionexp"));

        playerlevel = PlayerPrefs.GetFloat(currentplayer + "_PlayerLevel");

        addexp.text       = "Experience : " + addexperience;
        subtractexp.text  = "Experience : " + subtractexperience;
        multiplytexp.text = "Experience : " + multiplyexperience;
        divideexp.text    = "Experience : " + divideexperience;

        setLevel();

        if (GS.getMusic() == 0)
        {
            GameObject gomusic = GameObject.Find("HomeMusic");
            Destroy(gomusic, 0);
        }
    }
Example #2
0
    void Start()
    {
        sn            = SceneManager.GetActiveScene();
        GS            = GetComponent <gameSelected> ();
        firstTimeName = PlayerPrefs.GetString("FirstPlayer");

        if (firstTimeName == "true" || firstTimeName == "" || firstTimeName == null)
        {
            PlayerPrefs.SetString("FirstPlayer", "true");
            imgname.SetActive(true);
        }
        else
        {
            imgname.SetActive(false);
        }


        activenames = new List <string>();

        RetrieveNames();

        for (int n = 0; n < names.Length; n++)
        {
            if (names[n] == GS.getCurrentPlayer())
            {
                dropDown.value = n;
                break;
            }
        }
    }
Example #3
0
    void Start()
    {
        GS = GetComponent <gameSelected> ();

        inputtype = GS.getCharacterInput();
        if (inputtype == 0)
        {
            inputTap.GetComponent <Image> ().color   = new Color(148f / 255f, 255f / 255f, 162f / 255f);
            inputSwipe.GetComponent <Image> ().color = new Color(255f / 255f, 109f / 255f, 109f / 255f);
        }
        else if (inputtype == 1)
        {
            inputTap.GetComponent <Image> ().color   = new Color(255f / 255f, 109f / 255f, 109f / 255f);
            inputSwipe.GetComponent <Image> ().color = new Color(148f / 255f, 255f / 255f, 162f / 255f);
        }

        musictype = GS.getMusic();
        if (musictype == 2)
        {
            musicOn.GetComponent <Image> ().color  = new Color(255f / 255f, 109f / 255f, 109f / 255f);
            musicOff.GetComponent <Image> ().color = new Color(148f / 255f, 255f / 255f, 162f / 255f);
        }
        else if (musictype == 1)
        {
            musicOn.GetComponent <Image> ().color  = new Color(148f / 255f, 255f / 255f, 162f / 255f);
            musicOff.GetComponent <Image> ().color = new Color(255f / 255f, 109f / 255f, 109f / 255f);
        }

        soundtype = GS.getSound();
        if (soundtype == 2)
        {
            soundOn.GetComponent <Image> ().color  = new Color(255f / 255f, 109f / 255f, 109f / 255f);
            soundOff.GetComponent <Image> ().color = new Color(148f / 255f, 255f / 255f, 162f / 255f);
        }
        else if (soundtype == 1)
        {
            soundOn.GetComponent <Image> ().color  = new Color(148f / 255f, 255f / 255f, 162f / 255f);
            soundOff.GetComponent <Image> ().color = new Color(255f / 255f, 109f / 255f, 109f / 255f);
        }
    }
Example #4
0
 void Start()
 {
     Time.timeScale = 1;
     GS             = GetComponent <gameSelected> ();
 }