본문 바로가기

EXPERIENCE/Unity

[Unity] 빠른 HTTP 통신을 위한 유니티 에셋 추천

728x90
728x90

 

 

기본 HTTP 통신이 느리다고 생각되어 에셋을 사용해보았고,

확실히 더 빠른 이미지 로딩을 볼 수 있었다.

 

 

Asset 링크
 

Best HTTP/2 | 네트워크 | Unity Asset Store

Get the Best HTTP/2 package from Tivadar György Nagy and speed up your game development process. Find this & other 네트워크 options on the Unity Asset Store.

assetstore.unity.com

 

 

샘플 링크
 

GitHub - Benedicht/BestHTTP_Examples: Example sources of the BestHTTP Unity3D plugin (http://u3d.as/5sb).

Example sources of the BestHTTP Unity3D plugin (http://u3d.as/5sb). - GitHub - Benedicht/BestHTTP_Examples: Example sources of the BestHTTP Unity3D plugin (http://u3d.as/5sb).

github.com

 

 

728x90

 

 

간단한 사용법
        string address = string.Format(url);
        HTTPRequest request = new HTTPRequest(new System.Uri(address));
        // 시간초과 기준 10초
        request.Timeout = TimeSpan.FromSeconds(10.0);
        Texture2D TargetTexture = await request.GetAsTexture2DAsync();

        BackGround.texture = TargetTexture;
        BackGround.color = Color.white;

        request.Dispose();
        request.Clear();

 

 

위 사용법은 샘플을 보고 간단히 이미지 로드 관련 코드를 작성한 것이다.

유료 에셋인게 단점이지만 중요한 프로젝트라면 사용해도 좋을 것 같다 :)

 

 

 

 

 

 

 

 

728x90
728x90