Exemple #1
0
    public void Start()
    {
        path          = Application.dataPath;
        fileName      = "Settings";
        fileExtension = ".data";

        base.Awake();

        AddListenerToSlider();

        if (SerializationManager.FileExists(path, fileName, fileExtension))
        {
            currentSettings = SerializationManager.LoadFile(path, fileName, fileExtension, SerializationManager.SerializationMode.Binary) as GameSettings;
            SetUIToCurrentSettings();
        }
        else
        {
            currentSettings = ReadSettingsFromUI();
        }

        Invoke(nameof(ApplySettingsToGame), 0.01f);
    }