2D Toolkit Forum

2D Toolkit => Support => Topic started by: fallingbrickwork on September 15, 2014, 09:53:11 am

Title: NullReferenceException in GetMeshDimensionsForString Unity 4.5.4f1
Post by: fallingbrickwork on September 15, 2014, 09:53:11 am
Hi,

I seem to have acquired a NullReferenceException via my call to GetEstimatedMeshBoundsForString since updating unity to 4.5.4f1.

Is this something my end or an issue in the tk2d core.. btw i'm on 2.4.0. Would updating to 2.5 fix this? Is these something I can amend in the code for a 'quick fix'?

Regards,
Matt.
Title: Re: NullReferenceException in GetMeshDimensionsForString Unity 4.5.4f1
Post by: unikronsoftware on September 15, 2014, 11:43:20 am
Can you paste the specific error  + line numbers please?
Title: Re: NullReferenceException in GetMeshDimensionsForString Unity 4.5.4f1
Post by: fallingbrickwork on September 15, 2014, 12:20:28 pm
NullReferenceException: Object reference not set to an instance of an object
tk2dTextGeomGen.GetMeshDimensionsForString (System.String str, .GeomData geomData) (at Assets/TK2DROOT/tk2d/Code/Fonts/tk2dTextGeomGen.cs:78)
tk2dTextMesh.GetEstimatedMeshBoundsForString (System.String str) (at Assets/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:517)
Title: Re: NullReferenceException in GetMeshDimensionsForString Unity 4.5.4f1
Post by: unikronsoftware on September 15, 2014, 01:04:18 pm
GetEstimatedMeshBoundsForString - is there an InitInstance() right at the start of the function? My vpn isn't working and I can't roll back history to check...
Title: Re: NullReferenceException in GetMeshDimensionsForString Unity 4.5.4f1
Post by: fallingbrickwork on September 15, 2014, 01:14:49 pm
Yes there is... the very first line.
Title: Re: NullReferenceException in GetMeshDimensionsForString Unity 4.5.4f1
Post by: unikronsoftware on September 15, 2014, 01:16:30 pm
Hmmm.. is the font still bound properly on it?
Title: Re: NullReferenceException in GetMeshDimensionsForString Unity 4.5.4f1
Post by: fallingbrickwork on September 15, 2014, 01:19:26 pm
Ahh, the font.... yes that is what it is... updating Unity seems to have messed up my fonts. Not on all the Tk2dTextMesh, but on some.. hmmm.

Many thanks for helping to track it down... it appears the issue is with this.

Many thanks,
Matt.