Hi there
I'm using a tk2dTextMesh and calling Commit() because I need the bounds in the same frame.
However I seem to be getting an error in tk2dTextGeomGen.cs, method 'GetMeshDimensionsForString' in line 39:
'for (int i = 0; i < str.Length && target < data.maxChars; ++i)'
I get an object not defined (null) error in the str property. What's really strange about it is that the cause of it seems really unreliable. What I've found so far:
1) It only happens when Commit() is called twice on the same textmesh in the same frame.
2) Placing two Commit() calls right after each other works fine, it has to be an external class call
3) Not all external calls break it - it seems to happen more when being called through delegates, but not all the time.
4) I setup a blank project and can't seem to replicate the issue, which I realize makes answering this question a lot more difficult.
My only guess is that when Commit calls FlushQueues, perhaps the delegates are firing at the same time (as far as C# is concerned anyway), removing the text mesh in the wrong order and causing an issue. I'm not sure, it's very weird.
Any advice on what might cause this method to fall over? I'm using tk2d 2.5.4 and Unity 5.2.0f3.