Table of Contents

Class ConfigLoader

Namespace
Framework.Systems.Config
Assembly
Assembly-CSharp.dll

IConfigLoader 구현체. JSON 설정은 IJsonSerializer(Newtonsoft), ScriptableObject는 Resources.Load.

public class ConfigLoader : IConfigLoader
Inheritance
object
ConfigLoader
Implements

Remarks

[직렬화 선택 이유] 설정 파일은 IJsonSerializer(Newtonsoft.Json) 유지. 이유: 사람이 직접 편집, 디버깅 필요, 외부 서버 JSON API 연동 가능성. [금지] MemoryPack — 사람이 수정하는 설정 파일에 바이너리 금지. JSON 경로: Application.streamingAssetsPath/{key}.json ScriptableObject 경로: Resources/{key} ConfigCache로 동일 key 반복 로드 방지.

Constructors

ConfigLoader(IJsonSerializer, ILogSystem, IExceptionHandler)

public ConfigLoader(IJsonSerializer serializer, ILogSystem log, IExceptionHandler exceptionHandler)

Parameters

serializer IJsonSerializer
log ILogSystem
exceptionHandler IExceptionHandler

Methods

LoadAsync<T>(string, CancellationToken)

JSON 파일 비동기 로드. 실패 시 null 반환.

public UniTask<T> LoadAsync<T>(string key, CancellationToken ct = default) where T : class

Parameters

key string

파일명 (확장자 제외). StreamingAssets 기준 상대 경로.

ct CancellationToken

로드 취소 신호.

Returns

UniTask<T>

로드된 설정 객체. 실패 시 null.

Type Parameters

T

역직렬화 대상 타입 (class).

Load<T>(string)

ScriptableObject 동기 로드. Resources 폴더 기준.

public T Load<T>(string key) where T : ScriptableObject

Parameters

key string

Resources 폴더 기준 경로 (확장자 제외).

Returns

T

로드된 ScriptableObject. 실패 시 null (Error 로그 출력).

Type Parameters

T

ScriptableObject 파생 타입.