1
Support / Re: Windows Store: Problem loading Texture2D / Creating a tk2dSprite
« on: September 04, 2013, 02:26:41 am »
Ok, here's the problem...
There are some components used by tk2dsprite.cs and tk2dTextMesh.cs (and maybe others) that, for whatever reason, are null. According to Unikron support, they are tagged as Required Components, but yet still seem to be null.
For instance, in the Awake() function of tk2dsprite.cs, there's a line:
In this case, GetComponent<MeshFilter>() returns a null, so I had to change to code like this:
There was one other place in tk2dsprite.cs and 2 places in tk2dTextMesh.cs where I had to do the same thing.
I hope this helps someone...
Dan
There are some components used by tk2dsprite.cs and tk2dTextMesh.cs (and maybe others) that, for whatever reason, are null. According to Unikron support, they are tagged as Required Components, but yet still seem to be null.
For instance, in the Awake() function of tk2dsprite.cs, there's a line:
Code: [Select]
GetComponent<MeshFilter>().mesh = mesh;
In this case, GetComponent<MeshFilter>() returns a null, so I had to change to code like this:
Code: [Select]
MeshFilter mf = GetComponent<MeshFilter>();
if (mf == null) { mf = gameObject.AddComponent<MeshFilter>(); }
mf.mesh = mesh;
There was one other place in tk2dsprite.cs and 2 places in tk2dTextMesh.cs where I had to do the same thing.
I hope this helps someone...
Dan