Esempio n. 1
0
    void Load()
    {
        try
        {
            OptionsXML xml = XMLSerialization.FileToObject <OptionsXML>(GetFilePath());
            if (xml != null)
            {
                UISetFrameRate(xml.targetFrameRate);
                UISetVSyncCount(xml.vSyncCount);
                UISetRefreshRate(xml.targetRefreshRate);
                UISetMaxQueuedFrames(xml.maxQueuedFrames);
                UISetMouseSpeed(xml.mouseSpeed);
                UISetMouseButton(xml.useButtonInsteadOfMouseMove, xml.inputKey);
                UISetFPSFontSize(xml.FPSFontSize);
                UISetFrameFontSize(xml.FrameFontSize);
                UISetFrameChangeColor(xml.frameChangeColor);

                Apply();
            }
        }
        catch (Exception ex)
        {
            Debug.LogError("Failed to Load Options - " + ex.Message);
        }
    }
Esempio n. 2
0
    void SaveToFile()
    {
        OptionsXML xml = new OptionsXML();

        xml.Set(Application.targetFrameRate, QualitySettings.vSyncCount, Screen.currentResolution.refreshRate, QualitySettings.maxQueuedFrames, (int)MouseTranslate.mouseSpeed,
                MouseTranslate.useButtonInsteadOfMouseMove, MouseTranslate.inputKey, FPSFontText.fontSize, FrameFontText.fontSize, frame.changeColors);

        XMLSerialization.ToXMLFile(xml, GetFilePath());
    }