Exemplo n.º 1
0
    public void ResetUserData()
    {
        // PlaterPrefs
        PlayerPrefsBool.SetBool("Pack", false);
        PlayerPrefsBool.SetBool("Pack (1)", false);
        PlayerPrefsBool.SetBool("Pack (2)", false);
        PlayerPrefsBool.SetBool("Pack (3)", false);
        PlayerPrefsBool.SetBool("Pack (4)", false);
        PlayerPrefsBool.SetBool("Pack (5)", false);
        PlayerPrefsBool.SetBool("Pack123", false);
        PlayerPrefsBool.SetBool("Pack456", false);
        PlayerPrefsBool.SetBool("PackAll", false);
        PlayerPrefs.SetInt("CurrencyAmount", CurrencyControl.currencyAmount * 0);
        PlayerPrefsBool.SetBool("Level7", false);
        PlayerPrefsBool.SetBool("SevenElever", false);
        LeverPulls.leverpulls = 0;

        Userlevels.GetInstance().ClearUserLevels();

        // XML's
        var signsPath = GetFilePath(Constants.XmlFiles.Signs);
        var bindata   = (TextAsset)Resources.Load("Signs");

        File.WriteAllBytes(signsPath, bindata.bytes);
        signsPath = GetFilePath(Constants.XmlFiles.Sentences);
        bindata   = (TextAsset)Resources.Load("Sentences");
        File.WriteAllBytes(signsPath, bindata.bytes);
        signsPath = GetFilePath(Constants.XmlFiles.Alphabet);
        bindata   = (TextAsset)Resources.Load("Alphabet");
        File.WriteAllBytes(signsPath, bindata.bytes);

        LoadData();
    }
Exemplo n.º 2
0
 IEnumerator ShouldRoomChange()
 {
     //while (!(isPlayerHere && isSidekickHere))
     while (!(isPlayerHere && isSidekickHere))
     {
         yield return(new WaitForSeconds(0.5f));
     }
     //  Debug.Log("room change");
     Userlevels.GetInstance().AddUserLevel(GrandAccesToLevelId);
     GameObject.FindGameObjectWithTag(Constants.Tags.SpeechCanvas).SetActive(false);
     endLevel.SetActive(true);
     endLevel.GetComponent <EndLevelScreen> ().NextLevel = NextLevelName;
     if (GetComponent <AudioSource> () != null)
     {
         GetComponent <AudioSource> ().Play();
     }
 }
Exemplo n.º 3
0
    void UnlockLevelSeven()
    {
        if (PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) >= cost && PlayerPrefsBool.GetBool("Level7") == false)
        {
            PlayerPrefsBool.SetBool("Level7", true);
            Userlevels.GetInstance().AddUserLevel("7");
            PlayerPrefs.SetInt("CurrencyAmount", PlayerPrefs.GetInt("CurrencyAmount", CurrencyControl.currencyAmount) - cost);

            if (ls != null)
            {
                ls.GetComponent <LevelSelector>().UpdateLevels();
            }
            else
            {
                Application.LoadLevel("Level3Beta");
            }
        }
    }