기본 구조 세팅 중
This commit is contained in:
60
Assets/Scripts/Studio/Config/StudioAppConfig.cs
Normal file
60
Assets/Scripts/Studio/Config/StudioAppConfig.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using static UVC.Util.WindowTools;
|
||||
|
||||
namespace UVC.Studio.Config
|
||||
{
|
||||
/// <summary>
|
||||
/// 애플리케이션의 설정을 관리하는 클래스입니다. AppConfig.json 파일에서 설정을 로드합니다.
|
||||
/// </summary>
|
||||
public class StudioAppConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// 로드된 애플리케이션 설정을 담고 있는 정적 인스턴스입니다.
|
||||
/// </summary>
|
||||
public static StudioAppConfig Config { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Windows 런타임 환경에서 StreamingAssets 폴더의 AppConfig.json 파일로부터 설정을 로드합니다.
|
||||
/// </summary>
|
||||
/// <returns>설정 로드 성공 여부를 반환합니다.</returns>
|
||||
public static bool LoadConfig()
|
||||
{
|
||||
string path = Path.Combine(Application.streamingAssetsPath, "AppConfig.json");
|
||||
if (File.Exists(path))
|
||||
{
|
||||
string json = File.ReadAllText(path);
|
||||
Config = JsonConvert.DeserializeObject<StudioAppConfig>(json);
|
||||
Debug.Log($"AppConfig loaded from {path}");
|
||||
return Config != null;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"File not found: {path}");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 애플리케이션의 언어 설정입니다.
|
||||
/// </summary>
|
||||
[JsonProperty("language")]
|
||||
public string Language { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 목표 프레임 레이트 설정입니다.
|
||||
/// </summary>
|
||||
[JsonProperty("targetFrameRate")]
|
||||
public int TargetFrameRate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 애플리케이션의 창 관련 설정입니다.
|
||||
/// </summary>
|
||||
[JsonProperty("window")]
|
||||
public WindowInfoData Window { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user