~~~~~ 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)