void OnGUI() { if (GUI.Button(new Rect(0, 0, 200, 50), "WWW")) { Debug.Log("WWW"); www = WWW.LoadFromCacheOrDownload("ftp://192.168.28.80/Windows32/Assets.Resources.LogicPrefab.Pet.P-M-Egg1.assetbundle", 1); StartCoroutine(WWWCoroutine()); } if (GUI.Button(new Rect(0, 50, 200, 50), "www.assetBundle.Load")) { Debug.Log("www.assetBundle.Load"); // asset = www.assetBundle.mainAsset; StartCoroutine(AssetBundleLoadAsync()); } if (GUI.Button(new Rect(200, 50, 200, 50), "www.assetBundle.unload(false)")) { Debug.Log("www.assetBundle.unload(false)"); www.assetBundle.Unload(false); www = null; } if (GUI.Button(new Rect(400, 50, 200, 50), "www.assetBundle.unload(true)")) { Debug.Log("www.assetBundle.unload(true)"); www.assetBundle.Unload(true); } if (GUI.Button(new Rect(0, 100, 200, 50), "Instantiate")) { Debug.Log("Instantiate"); ins = GameObject.Instantiate(asset, Vector3.zero, Quaternion.identity) as GameObject; } if (GUI.Button(new Rect(200, 100, 200, 50), "Destroy")) { Debug.Log("Destroy"); GameObject.Destroy(ins); ins = null; } if (GUI.Button(new Rect(0, 150, 200, 50), " Resources.UnloadUnusedAssets")) { Debug.Log("Resources.UnloadUnusedAssets"); Resources.UnloadUnusedAssets(); } if (GUI.Button(new Rect(200, 150, 200, 50), " Resources.UnloadUnusedAssets && SetNull")) { Debug.Log("Resources.UnloadUnusedAssets && SetNul"); asset = null; Resources.UnloadUnusedAssets(); } }