Table of Contents

Interface IConfigLoader

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

설정 로드 인터페이스. ScriptableObject + JSON 통합 로드 추상화.

public interface IConfigLoader

Examples

var config = await _configLoader.LoadAsync<EnemyConfig>("Enemies/Goblin", ct);
var so = _configLoader.Load<GameSettingsSO>("GameSettings");

Remarks

JSON 설정: StreamingAssets/{key}.json 경로에서 비동기 로드. ScriptableObject 설정: Resources/{key} 경로에서 동기 로드. ConfigCache가 내부에서 동일 key 반복 로드를 방지한다.

Methods

LoadAsync<T>(string, CancellationToken)

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

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 폴더 기준.

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

Parameters

key string

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

Returns

T

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

Type Parameters

T

ScriptableObject 파생 타입.