using Newtonsoft.Json; using UnityEngine; using Octopus.Simulator.Networks; namespace UVC.Networks { public class ApiConfigLoader { public APIEndPointsConfig ApiConfig { get; private set; } public APIEndPointsConfig LoadFromResources(string resourcePath) { TextAsset jsonAsset = Resources.Load(resourcePath); if (jsonAsset == null) { Debug.LogError($"ApiConfig ¸®¼Ò½º¸¦ ãÀ» ¼ö ¾ø½À´Ï´Ù: {resourcePath}"); return null; } ApiConfig = JsonConvert.DeserializeObject(jsonAsset.text); return ApiConfig; } public APIEndPointsConfig LoadFromJsonString(string json) { ApiConfig = JsonConvert.DeserializeObject(json); return ApiConfig; } } }