Search Unity

Resolved Pink prefab because of BumpedDiffuse shader

Discussion in 'General Graphics' started by R0tmayer, Jul 17, 2021.

  1. R0tmayer

    R0tmayer

    Joined:
    Mar 13, 2021
    Posts:
    12
    Hi everyone!

    I'm trying to download assetBundle from server and unzip it. All is working fine with Standard Shader Material (u can see it on the video).

    But if material in assetBundle is Mobile/BumpedDiffuse so prefab instantiated with pink color like no material attached to prefab. But if I click to prefab I can see that there is attached material on this prefab. And there are texture map on material. And the most interesting thing that if i changed shader to any other all is fine even if I changed from Mobile/BumpedDiffuse to Mobile/BumpedDiffuse

    In general, watch my video.


    Thank you.




    Here is my script:


    Code (CSharp):
    1. private IEnumerator DownloadPrefabContent(string url)
    2.     {
    3.         var www = UnityWebRequestAssetBundle.GetAssetBundle(url);
    4.         yield return www.SendWebRequest();
    5.  
    6.         AssetBundle assetBundle = DownloadHandlerAssetBundle.GetContent(www);
    7.  
    8.         var prefabRequest = assetBundle.LoadAssetAsync<GameObject>("prefab.prefab");
    9.         yield return prefabRequest;
    10.  
    11.         GameObject prefab = null;
    12.         prefab = prefabRequest.asset as GameObject;
    13.         _sessionContext.AddPrefabToList(prefab);
    14.         Instantiate(prefab, prefab.transform.position, Quaternion.identity);
    15.     }
     
    Last edited: Jul 17, 2021
  2. R0tmayer

    R0tmayer

    Joined:
    Mar 13, 2021
    Posts:
    12