DownloadService
UnityWebRequest
,DownloadHandler
기반의 리소스 다운로드 시스템 제공DownloadHandlerModule<TReturn>
,IDownloadHandlerModule
을 통한 커스텀DownloadHandler
개발 및 처리 인터페이스 제공
- DownloadHandlerModule
DownloadHandlerScript
,IDownloadHandlerModule
기초 인터페이스 구현 제공
DownloadHandlerModule
을 통해UnityWebRequest
생성을 위임
GetContent()
구현을 통한 다운로드 결과 통합 처리
private void DownloadJsonFile<T>(string serverPath, Action<Result, T> callback = null) where T : class {
Service.GetService<DownloadService>().Download(new JsonDownloadHandler<T>(Path.Combine(config.url, serverPath), _plainEncryptKey), (result, handler) => {
using (handler) {
if (result == Result.Success) {
callback?.Invoke(result, handler.GetContent());
}
}
});
}
Last modified: 01 2월 2025