Beispiel #1
0
 private void Start()
 {
     if (!(saveController.settingStatusExists()))
     {
         settingStatus ss = new settingStatus();
         saveController.saveSetting(ss);
     }
 }
    public static void saveSettingStatus(settingStatus ss)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/settingStatus.forward";
        FileStream      stream    = new FileStream(path, FileMode.Create);

        formatter.Serialize(stream, ss);
        stream.Close();
    }
    private void changeTheme(string themeName)
    {
        settingStatus ss = saveController.loadSetting();

        ss.theme = themeName;
        saveController.saveSetting(ss);
        Debug.Log(ss.theme);

        Application.LoadLevel("mainMenu");
    }
Beispiel #4
0
    private void changeLanguage(string language)
    {
        settingStatus ss = fileManager.loadSettingStatus();

        ss.language = language;
        fileManager.saveSettingStatus(ss);

        LoadLocalizedText(language);
        changeSettingLanguage();
    }
    private void changeLocalization(string language)
    {
        settingStatus ss = saveController.loadSetting();

        ss.language = language;
        saveController.saveSetting(ss);

        LocalizationManager.instance.LoadLocalizedText(ss.language);

        Application.LoadLevel("mainMenu");
    }
Beispiel #6
0
    public static settingStatus loadSetting()
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/setting.pong";
        FileStream      stream    = new FileStream(path, FileMode.Open);

        settingStatus ss = formatter.Deserialize(stream) as settingStatus;

        stream.Close();

        return(ss);
    }
    // Use this for initialization
    private void Start()
    {
        this.GetComponent <InputField>().text = LocalizationManager.instance.GetLocalizedValue(key);

        settingStatus ss = saveController.loadSetting();

        if (ss.language == "persian")
        {
            text.font = LocalizationManager.instance.persianFont;
        }
        else if (ss.language == "english")
        {
            text.font = LocalizationManager.instance.englishFont;
        }
    }
Beispiel #8
0
    private void Start()
    {
        settingStatus ss = saveController.loadSetting();

        if (ss.theme == "graphicall")
        {
            graphicallUI.SetActive(true);

            classicUI.SetActive(false);
        }
        else
        {
            classicUI.SetActive(true);

            graphicallUI.SetActive(false);
        }
    }
    // Use this for initialization
    private void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);


        settingStatus ss = saveController.loadSetting();

        LoadLocalizedText(ss.language);
    }
    public static settingStatus loadSettingStatus()
    {
        settingStatus ss = new settingStatus();

        if (!ispSettingStatusExists())
        {
            saveSettingStatus(ss);
        }

        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/settingStatus.forward";
        FileStream      stream    = new FileStream(path, FileMode.Open);

        ss = formatter.Deserialize(stream) as settingStatus;
        stream.Close();

        return(ss);
    }
Beispiel #11
0
    protected virtual void Start()
    {
        ss = saveController.loadSetting();

        startTime = Time.time;

        instedElements = new GameObject[gameElements.Length];
        for (int i = 0; i < gameElements.Length; i++)
        {
            instedElements[i] = elementsInst(gameElements[i]);
        }

        assignPlayerNameToUI();

        instedElements[2].GetComponent <ball>().setRandomLook();

        loadLastStatus();
    }
Beispiel #12
0
    // Use this for initialization
    private void Start()
    {
        if (languageManager.instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(this.gameObject);


        settingStatus ss = fileManager.loadSettingStatus();

        LoadLocalizedText(ss.language);

        setting.instance.languageChanged += changeLanguage;
    }