찾기
내용으로 건너뛰기
추적
문서의 이전 판을 선택했습니다!
저장하면 이 자료로 새 판을 만듭니다.
미디어 파일
=====Loading and unloading objects from an AssetBundle===== Having created an AssetBundle object from the downloaded data, you can load the objects contained in it using three different methods: * [[ScriptRef:AssetBundle.Load.html|AssetBundle.Load]] will load an object using its name identifier as a parameter. The name is the one visible in the Project view. You can optionally pass an object type as an argument to the Load method to make sure the object loaded is of a specific type. * [[ScriptRef:AssetBundle.LoadAsync.html|AssetBundle.LoadAsync]] works the same as the Load method described above but it will not block the main thread while the asset is loaded. This is useful when loading large assets or many assets at once to avoid pauses in your application. * [[ScriptRef:AssetBundle.LoadAll.html|AssetBundle.LoadAll]] will load all the objects contained in your AssetBundle. As with AssetBundle.Load, you can optionally filter objects by their type. To unload assets you need to use [[ScriptRef:AssetBundle.Unload.html|AssetBundle.Unload]]. This method takes a boolean parameter which tells Unity whether to unload all data (including the loaded asset objects) or only the compressed data from the downloaded bundle. If your application is using some objects from the AssetBundle and you want to free some memory you can pass false to unload the compressed data from memory. If you want to completely unload everything from the AssetBundle you should pass true which will destroy the Assets loaded from the AssetBundle. =====Loading objects from an AssetBundles asynchronously===== You can use the [[ScriptRef:AssetBundle.LoadAsync.html|AssetBundle.LoadAsync]] method to load objects Asynchronously and reduce the likelihood of having hiccups in your application. <file csharp>using UnityEngine; IEnumerator Start () { // Start a download of the given URL WWW www = WWW.LoadFromCacheOrDownload (url, 1); // Wait for download to complete yield return www; // Load and retrieve the AssetBundle AssetBundle bundle = www.assetBundle; // Load the object asynchronously AssetBundleRequest request = bundle.LoadAsync ("myObject", typeof(GameObject)); // Wait for completion yield return request; // Get the reference to the loaded object GameObject obj = request.asset as GameObject; }</file> [[AssetBundlesIntro|back to AssetBundles Intro]] {{tag>유니티 unity}} * 출처: [[http://unitykoreawiki.com/index.php?n=KrMain.LoadingAssetBundles|유니티코리아위키]] (CC BY-NC-SA 2.0)
2+1?
이 필드는 비어 있도록 유지하세요:
저장
미리 보기
취소
편집 요약
참고: 이 문서를 편집하면 내용은 다음 라이선스에 따라 배포하는 데 동의하는 것으로 간주합니다:
CC Attribution-Noncommercial-Share Alike 4.0 International
연결문서
유니티3D ( Unity3D )
문서 도구
문서 보기
이전 판
연결문서
맨 위로
다크 모드로 보기
☀️
Toggle Menu
유니티3D ( Unity3D )
너두 고쳐두 됩니다.
사이트 도구
최근 바뀜
미디어 관리자
사이트맵
사용자 도구
등록
로긴
최근 수정된 문서
misuse_topical5
노박
unique_items
dinner_bell
deputy_beagle
ratslayer
one_for_my_baby
alerio
power_fist
제거됨
fixer
climb_ev_ry_mountain
companion
[장비 분실]
crashed_vertibird
brotherhood_t-51b_power_armor
marco
i_forgot_to_remember_to_forget
cateye