Unity3d Load Assetbundle (different platforms)

Source: Internet
Author: User

~~~~~ outside ~~~~~

Company work machine can not sisu network, neglect to tidy up their knowledge, leading to a lot of knowledge points to understand many times, still forgotten. Slowly start finishing at home after work ~ ~

Business

Unity3d has four loading mechanisms:

//server Address sample string sURL = "HTTP://192.168.X.X/HSS" + "/test.assetbundle";//Local Address sample/***** * Read and Write permissions for different platform Application.persistentdatapath paths ( Need multi-threaded download of the brothers and Sisters of the Gospel) * Assetbundle files on different platforms to be packaged on different platforms, building files on different platforms of unity are not possible * e.g. The iOS Assetbundle file must be built with unity on the iOS system's machine (pit for a long time) *****/string Slocalurl = "file://" +application.persistentdatapath+ "/test.assetbundle";//Method 1/****** * Asynchronous *******/www www = new www (surl); yield return www;//Method 2 = = Method 1/**** * * Async *******/www WWW2 = WWW. Loadfromcacheordownload (surl,0); yield return www2;//method 3/****** * Synchronous *******/assetbundle.createfromfile (SURL);// Method 4/****** * Async *******/byte[] bs = file.readallbytes (Slocalurl); Assetbundlecreaterequest ABQ = Assetbundle.createfrommemory (BS); yield return abq;//loaded into the game assetbundle AB = Www.assetBundle;//abq.assetBundle; Gameobject Gobj = ab. Load ("name") as gameobject;//name is the name of obj in the preset instantiate (Gobj); 



Unity3d Load Assetbundle (different platforms)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.