본문 바로가기

develop

(25)
[Unity] AssetBundle 사용하기 - Web, Server - 서버가 있을 때는 서버를 사용하지만, 이번 예시에서는 드롭박스를 사용하겠습니다. 이전 포스트에서 생성한 AssetBundle을 드롭박스의 public 폴더에 올리고, 우클릭으로 링크를 얻습니다. 그 링크를 path에 삽입하고 AssetBundle을 로드해 보겠습니다. using UnityEngine; using System.Collections; public class LoadAssetBundleFromWeb : MonoBehaviour { // url은 드롭박스의 public 폴더에 올린 AssetBundle의 링크 주소다. // 서버에서 로드하기 위해서는 http://로 시작하는 주소를 사용한다. private string path = "url"; // 버튼 이벤트가 발생하면 코루틴을 시작한다. ..
[Unity] AssetBundle 사용하기 - Local - AssetBundle을 로드하는 위치는 서버와 로컬 두 가지이다. - 우선 로컬에서 로드하는 방법을 알아 봅시다. - 첫 번째 방법. using System; using UnityEngine; using System.Collections; class NonCachingLoadExample : MonoBehaviour { public string BundleURL; public string AssetName; IEnumerator Start () { // Download the file from the URL. It will not be saved in the Cache using ( WWW www = new WWW ( BundleURL ) ) { yield return www; if ( www.err..
[Unity] AssetBundle 빌드하기 - AssetBundle을 생성하기 위한 코드. C# http://docs.unity3d.com/Documentation/ScriptReference/BuildPipeline.BuildAssetBundle.html 주의 : 이 코드를 포함하고 있는 스크립트는 유니티 엔진 프로젝트에 Editor 폴더를 만들고 그 하위에 두어야 한다. Editor 폴더의 위치는 상관 없다. // C# Example // Builds an asset bundle from the selected objects in the project view. // Once compiled go to "Menu" -> "Assets" and select one of the choices // to build the Asset Bundle u..
[Unity] Assetbundle 사용하기 Unity3d 엔진을 활용해서 모바일에서 데이터를 쓰려면 결국 Assetbundle을 사용해야 한다. 이유는 용량 때문이다. 디바이스에 맞는 마켓에서 게임을 다운 받을 때 큰 용량을 다운로드 한다면, 시간이 오래 걸리고 사용자가 이탈할 확률이 높기 때문이다. 그리고 특히 잦은 패치를 해야하는 어플리케이션은 Assetbundle을 꼭 사용해야 좋다. Assetbundle을 ios나 android 버전으로 만드는 것은 간단하다. [MenuItem ( "Assets/Build AssetBundle From Selection Android - Track dependencies" )] static void ExportResourceToAssetBundle () { string FilePath = EditorUni..

반응형