{"id":4501,"date":"2017-01-22T17:51:30","date_gmt":"2017-01-22T09:51:30","guid":{"rendered":"http:\/\/1darray.com\/blog\/?p=4501"},"modified":"2017-08-02T19:03:06","modified_gmt":"2017-08-02T11:03:06","slug":"load-assetbundles-with-caching","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2017\/01\/22\/load-assetbundles-with-caching\/","title":{"rendered":"Load AssetBundles with Caching"},"content":{"rendered":"<p>Small sample script to load assetbundles.<\/p>\n<p><strong>Features:<\/strong><br \/>\n&#8211; It first loads bundle hash from the manifest file on server<br \/>\n&#8211; Then uses that hash string as asset bundle loader parameter (to use cached version if available, <a href=\"https:\/\/docs.unity3d.com\/ScriptReference\/Networking.UnityWebRequest.GetAssetBundle.html\">see docs<\/a>)<br \/>\n&#8211; Instantiate gameobject after loading<\/p>\n<p><strong>source:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/UnityCommunity\/UnityLibrary\/blob\/master\/Assets\/Scripts\/AssetBundles\/AssetBundleLoader.cs\"> https:\/\/github.com\/UnityCommunity\/UnityLibrary\/blob\/master\/Assets\/Scripts\/AssetBundles\/AssetBundleLoader.cs<\/a><\/p>\n<p>*Note: there is some memory leak happening with this script (unity 5.5.3)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Small sample script to load assetbundles. Features: &#8211; It first loads bundle hash from the manifest file on server &#8211; Then uses that hash string as asset bundle loader parameter (to use cached version if available, see docs) &#8211; Instantiate gameobject after loading source: https:\/\/github.com\/UnityCommunity\/UnityLibrary\/blob\/master\/Assets\/Scripts\/AssetBundles\/AssetBundleLoader.cs [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Load AssetBundles with caching","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[804,3],"tags":[402,963,962,811,967,968,965,966,843,964,924,484],"class_list":["post-4501","post","type-post","status-publish","format-standard","hentry","category-scripts","category-unity3d","tag-asset","tag-asset-bundle","tag-assetbundle","tag-bundle","tag-cache","tag-cached","tag-getassetbundle","tag-hash","tag-load","tag-unitywebrequest","tag-version","tag-www"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-1aB","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=4501"}],"version-history":[{"count":4,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4501\/revisions"}],"predecessor-version":[{"id":4581,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4501\/revisions\/4581"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=4501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=4501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=4501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}