using Newtonsoft.Json; using System.IO; using UnityEngine; using static UVC.Util.WindowTools; namespace UVC.Studio.Config { /// /// 애플리케이션의 설정을 관리하는 클래스입니다. AppConfig.json 파일에서 설정을 로드합니다. /// public class StudioAppConfig { /// /// 로드된 애플리케이션 설정을 담고 있는 정적 인스턴스입니다. /// public static StudioAppConfig Config { get; private set; } /// /// Windows 런타임 환경에서 StreamingAssets 폴더의 AppConfig.json 파일로부터 설정을 로드합니다. /// /// 설정 로드 성공 여부를 반환합니다. public static bool LoadConfig() { string path = Path.Combine(Application.streamingAssetsPath, "AppConfig.json"); if (File.Exists(path)) { string json = File.ReadAllText(path); Config = JsonConvert.DeserializeObject(json); Debug.Log($"AppConfig loaded from {path}"); return Config != null; } else { Debug.LogError($"File not found: {path}"); } return false; } /// /// 애플리케이션의 언어 설정입니다. /// [JsonProperty("language")] public string Language { get; set; } /// /// 목표 프레임 레이트 설정입니다. /// [JsonProperty("targetFrameRate")] public int TargetFrameRate { get; set; } /// /// 애플리케이션의 창 관련 설정입니다. /// [JsonProperty("window")] public WindowInfoData Window { get; set; } } }