UnityEngine.AssetBundle.LoadAll C# (CSharp) Method

LoadAll() public method

public LoadAll ( ) : Object[]
return Object[]
		public Object[] LoadAll(){}
		public void Unload(bool unloadAllLoadedObjects){}

Same methods

AssetBundle::LoadAll ( Type type ) : Object[]

Usage Example

コード例 #1
2
ファイル: LuaHelper.cs プロジェクト: coder-han/hugula
 /// <summary>
 /// 刷新shader
 /// </summary>
 /// <param name="assetBundle"></param>
 public static void RefreshShader(AssetBundle assetBundle)
 {
     #if UNITY_5
     UnityEngine.Material[] materials = assetBundle.LoadAllAssets<Material>();
     #else
     UnityEngine.Object[] materials = assetBundle.LoadAll(typeof(Material));  //LoadAll<Material>();
     #endif
     foreach (UnityEngine.Object m in materials)
     {
         Material mat = m as Material;
         string shaderName = mat.shader.name;
         Shader newShader = Shader.Find(shaderName);
         if (newShader != null)
         {
             mat.shader = newShader;
         }
         else
         {
             Debug.LogWarning("unable to refresh shader: " + shaderName + " in material " + m.name);
         }
     }
 }
All Usage Examples Of UnityEngine.AssetBundle::LoadAll