I am trying assetbundles with Unity 5 and I have an error with scripts included in assetbundles. This is my source code for AssetBundles import. Why the TextAsset variable is always null? I use this code from Unity documentation http://docs.unity3d.com/Manual/scriptsinassetbundles.html
AssetBundle bundle = www.assetBundle;
if(bundle != null)
{
// txt TextAsset is always null !!!
TextAsset txt = bundle.LoadAsset(prefabNameInAssetBundle, typeof(TextAsset)) as TextAsset;
// resObj is always != null, it's ok
UnityEngine.Object resObj = bundle.LoadAsset(prefabNameInAssetBundle);
if (resObj != null)
newGO = (GameObject)GameObject.Instantiate(resObj);
bundle.Unload(false);
}