|
dona, Jr. Member
Posted: 12 October 2012 08:48 AM Total Posts: 46
Hi,
I’ve added meshes and texture materials in to AssetLibrary at the time of external file loading completion. At the end of current game level, I called AssetLibrary.removeAllAssets(true) and disposed the level container mesh for cleaning the memory.But it throws error while i trying to load next level.
Here is the error,
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at away3d.materials.passes::DefaultScreenPass/activate()[F:\Away\raycast\exp\src\away3d\materials\passes\DefaultScreenPass.as:511]
at away3d.materials::MaterialBase/activatePass()[F:\Away\raycast\exp\src\away3d\materials\MaterialBase.as:352]
at away3d.core.render::DefaultRenderer/drawRenderables()[F:\Away\raycast\exp\src\away3d\core\render\DefaultRenderer.as:152]
at away3d.core.render::DefaultRenderer/draw()[F:\Away\raycast\exp\src\away3d\core\render\DefaultRenderer.as:103]
at away3d.core.render::RendererBase/executeRender()[F:\Away\raycast\exp\src\away3d\core\render\RendererBase.as:271]
at away3d.core.render::DefaultRenderer/executeRender()[F:\Away\raycast\exp\src\away3d\core\render\DefaultRenderer.as:62]
at away3d.core.render::RendererBase/render()[F:\Away\raycast\exp\src\away3d\core\render\RendererBase.as:235]
at away3d.containers::View3D/render()[F:\Away\raycast\backups\exp\src\away3d\containers\View3D.as:608]
var len : uint = _methods.length, i got _methods as null object
Could you guys, please tell me the best way to load and unload the game levels?
Thanks in advance
|
dona, Jr. Member
Posted: 12 October 2012 01:18 PM Total Posts: 46
[ # 1 ]
Anybody knows about it?
I tried using view.dispose() method for releasing the memory.But awaystats showing cumulative memory usage while loading the next level.
|
dona, Jr. Member
Posted: 12 October 2012 02:59 PM Total Posts: 46
[ # 2 ]
is there any issue around AssetLibrary.removeAllAssets(true).?
I’ve set AssetLibrary.conflictStrategy = ConflictStrategy.THROW_ERROR.
and called AssetLibrary.removeAllAssets(true) at the level end and reloaded the same level. It throws
Error: Asset name collision while AssetLibrary.namingStrategy set to AssetLibrary.THROW_ERROR. Asset path: default,mesh
It seems that assets are not removed from the AssetLibrary by using ‘removeAllAssets’ instruction.
|
John Brookes, Moderator
Posted: 12 October 2012 03:17 PM Total Posts: 732
[ # 3 ]
Not sure if its still the case, but pre gold version I had a similar issue with removeAllAssets(true)
Ended up having each level with a unique name space and using
removeNamespaceAssets
|
dona, Jr. Member
Posted: 12 October 2012 03:43 PM Total Posts: 46
[ # 4 ]
Thanks a lot for your reply John,
I’m using away3D 4.0.9 (latest dev version). I’ll try your way.
I’ve one more doubt, how to control the memory usage, it showing in cumulative manner. Do you’ve any idea?
|
dona, Jr. Member
Posted: 13 October 2012 12:21 PM Total Posts: 46
[ # 5 ]
Now, the memory usage is almost fixed by disposing each objects separately.
I’ve one more doubt, still i’m not able to dispose texture materials, it always throwing the error,
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at away3d.materials.passes::DefaultScreenPass/invalidateShaderProgram()[..\away3d\materials\passes\DefaultScreenPass.as:647]
_methods as null object
.
|