Lots of reflection / GUI errors with version 3.5.9.1

Just updated to beta version 3.5.9.1 and now I constantly get lots of errors like below:

It is with Unity version 4.5.5

ReflectionTypeLoadException: The classes in the module cannot be loaded.
System.Reflection.Assembly.GetTypes () (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/Assembly.cs:371)
Pathfinding.AstarData.FindGraphTypes () (at Assets/AstarPathfindingProject/Core/AstarData.cs:388)
AstarPathEditor.DrawMainArea () (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:857)
AstarPathEditor.OnInspectorGUI () (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:453)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/Inspector/InspectorWindow.cs:1124)
UnityEditor.DockArea:OnGUI()

Unexpected top level layout group! Missing GUILayout.EndScrollView/EndVertical/EndHorizontal?
UnityEditor.DockArea:OnGUI()

GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced)


Also with Unity 4.6 , my scene was crashing the Unity and I think it is because of Astar project. Any scene with Astar Path game object crashes Unity. It may possibly due to cached start up data, but not sure. So I had to roll back to 4.5.5 to be able to open up the scene again, but then above errors will keep pop up.

When I have the errors I can’t add any graphs because GUI inspector for Astar Path throws errors.

Can we get some update to the Unity 4.6 and have the above errors fixed please?
If fixing would take longer time, can I have the 3.5.9 version somewhere? ( I assume this is what I had before because Astar warns me that data was built using 3.5.9)

Actually, I was able to roll back to the version before the beta update. And I think the version was 3.5.2 so that part is good. But still, would like to try beta and Unity 4.6 please

Hi

What build target are you using?

Windows PC platform. It is not just my scene. The example that comes with the Astar projects all gives reflection/GUI errors. But it doesn’t crash the Unity , so that is why I am suspecting that caching the navmesh at startup option ( or data stored ) is causing the crash.

Right now, I have rolled back to the 3.5.2 and Unity 4.5.5 , but as soon as I have some news about Astar working good with with Unity 4.6 then I want to jump in to try it out.

Also the later version of the Astar made caching the navmesh in the prefab obsolete so I need to do my own file saving if I scan it using API , so I am going to have to write some wrapper to do that. (and loading) <maybe a little example would be nice… simple editor script that let you do , create navmesh , save into file , load from file … >

Windows Store or the regular windows standalone?

I tested the project with U4.6f2 and it works perfectly fine.
Would it be possible to send me your project so that I could take a look at it?

About the caching.
Sorry about that, but it I could not find a way to implement it using the new Unity undo system without causing it to lag horribly in the editor. A lot of people complained about that, and storing it as a separate file seems to be the only reasonable way to do it.

Just a regular windows standalone.

My project is huge so it can’t be sent, but the error happens for example scenes too.

Maybe it happens if you create astar path object in older version 3.5.2 and then create cache and then just upgrade both unity and astar to the latest version. ?

I am not sure what conditions it happens exactly… but one thing for sure is that the astar path script was not displaying in the inspector correctly… it definitely had errors so the graph tab was not unfolding etc…

Let me just Update Astar only to the latest one and see if it happens again.

Ok, so I have just updated Astar to the latest beta , and it seems to work so far. No GUI errors.

So it must have been combination or just Unity 4.6 issue…

Before, I update to Unity 4.6 again, I will (want to) make my tool to save cache data into file and then load it in each scene load so it will take some time , but I will post again once I have done that. Maybe clearing the cache from gameobject will save my day.

I have some questions related to the saving to the file thou…

before I used to do this in my script to save navmesh :

serializationSettings.nodes = true;
serializationSettings.prettyPrint = false;

astarData.cacheStartup = true;
scanOnStartup = false;

AstarPath.active.astarData.DeserializeGraphs();

Scan();

astarData.SaveCacheData(serializationSettings);


Now… I set astarData.cacheStartup = true; because I want to set the astar path in the scene to load it when the scene is loaded.

for loading ,

Do I still need to check the astarData.cacheStartup = true; ?
I am guessing that I need to actually “load” the navmesh data into byte[] form and then load that into astar myself? So is “astarData.cacheStartup = true;” obsolete?

Hi

The cacheStartup field will make it load the data from astarData.file_cachedStartup on Awake (the variable is a reference to a TextAsset).

If you want to handle the saving and loading yourself, I suggest you take a look at this page: http://arongranberg.com/astar/docs_dev/save-load-graphs.php

Ok, spent hours and hours again on this, and I can gladly now say that it doesn’t look like it is astar issue causing the crash.

At first it did look like it because it was spitting out the errors , but after I upgraded the astar first and then cleaned up cache data etc… then moved to Unity 4.6, it causes no errors now!

But the scene still crashed, so I started to delete one game objects after another and after about more than 100 crashes I narrowed it down to something to do with 2dtoolkit with mesh collider with very very weird conditions.

I won’t tell everything here, but just letting everyone know that astar path is looking good and if anyone is having the similar issue as mine, just follow my step… Upgrade astar first and then to Unity 4.6

And for anyone who is interested with 2dtoolkit issue with Unity 4.6 here is thread I started on their forum.

http://2dtoolkit.com/forum/index.php/topic,4631.0.html

Ok, great to know that it wasn’t the A* Pathfinding Project that was causing issues.

I wish you good luck with solving the crash issue for the 2D toolkit.

  • Aron

PS: Marking your answer as accepted.