1、Resource.load(string path)
優點:同步,使用方便
缺點:只能加載Resource目錄下的資源
優點:同步,使用方便
缺點:只能加載Resource目錄下的資源
2、WWW
優點:靈活,可以加載Application.streamingAssetsPath、Application.persistentDataPath目錄下的資源,以及從網絡上下載資源
缺點:異步,如果業務需要按需加載資源,容易打散邏輯
3、AssetBundle.CreateFromFile(string path)
優點:同步,可以加載Application.persistentDataPath目錄下的AssetBundle
缺點:AssetBundle不能壓縮,在Android下不能加載Application.streamingAssetsPath下的AssetBundle
4、AssetBundle.CreateFromMemoryImmediate(byte[] binary)
優點:同步,可以加載Application.persistentDataPath目錄下壓縮過的AssetBundle
缺點:在Android下不能加載Application.streamingAssetsPath下的AssetBundle