Beispiel #1
0
 public Settings()
 {
     Color    = new ColorSettings();
     Graphics = new GraphicsSettings();
     Sound    = new SoundSettings();
     Debug    = new DebugSettings();
 }
Beispiel #2
0
        public void Load()
        {
            string path = Path.Combine(Application.persistentDataPath, "Settings.json");

            if (File.Exists(path))
            {
                string jsonSettings = File.ReadAllText(path);

                Settings settings = JsonConvert.DeserializeObject <Settings>(jsonSettings);
                // Load default colors until panel is made.
                // this.Color = settings.Color;
                this.Graphics = settings.Graphics;
                this.Sound    = settings.Sound;
                this.Debug    = settings.Debug;
            }
            else
            {
                Save();
            }
        }