Hello everyone.
I have posted [here][1] my problems but I still have my bug.
I created a compotent that send a debug message on each fonction call during frame( lateUpdate, onWilRendereObject ..) The last message i get is not always the same. So it's not a problems on one particular part of my code.
From the last post i now use asset bundle to load texture and mesh. the code(below) that instansiate the asset bundle. Since i have change this, the crash is quicker. About 10-15sec after the start of instantiating object the game crashs.
I though on last version that the crash was due to a overload of mermory. (It was always around 80% memory in use.) but now i have only 35%.
(there is only one game object in each assetbundle, but that contents different mesh and texture).
Something important, this crash always occurs on build but never on UnityEditor.
According to the error file, the module causing the error is
Module 1
C:\Windows\system32\DXGIDebug.dll
Before it' was not always the same module mentione ine the errorfile, whereas now; (Even on build not debug this module is in cause).
`IEnumerator loadDalles(){
assetBundles = new Dictionary();
foreach(var file in new DirectoryInfo(pathAssetBundle).GetFiles("*")){
System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();
watch.Start();
Debug.Log("Tring to load file " + file.FullName);
AssetBundle ab = AssetBundle.LoadFromFile(file.FullName);
Debug.Log("Load from file: " + watch.ElapsedMilliseconds);
CPUMemTest.INSTANCE.DebugMemoire();
if(ab == null){
continue;
}
//WWW www = new WWW(file.FullName);
//var www = WWW.LoadFromCacheOrDownload(files.FullName,0);
%|2009425653_14|%
//Debug.Log("Load Dalle " + myAB.LoadAllAssets().Length);
int nbItem = 0;
AssetBundleRequest request = ab.LoadAllAssetsAsync();
yield return request;
foreach(GameObject dalle in request.allAssets){
GameObject go = Instantiate(dalle);
go.name = go.name.Remove(go.name.IndexOf("(Clone)"));
assetBundles[go.name] = ab;
go.GetComponent().doAfterInstantiateAssetBundle();
nbItem ++;
yield return null;
}
Debug.Log("Time to instantiate one Dalle (ms) : " + watch.ElapsedMilliseconds + "nbItem load" + nbItem);
CPUMemTest.INSTANCE.DebugMemoire();
}
}
`
[1]: http://answers.unity3d.com/questions/1163121/acces-violation-with-build.html
↧