2D Toolkit Forum
2D Toolkit => Support => Topic started by: MariusVE on October 17, 2013, 07:22:03 pm
-
Hi,
I have purchased 2D Toolkit today (version 2.2.3) and after importing it in Unity, I have received the following error:
Assets/TK2DROOT/tk2d/Editor/Fonts/tk2dFontEditor.cs(165,60): error CS0117: `UnityEngine.TextureFormat' does not contain a definition for `RGBA4444'
I am using Unity 3D Pro v4.0.
Is there a solution for this ?
Thanks!
-
Hi,
What version of Unity are you on exactly? I've tested this in Unity 4.0.1f2, 4.1.5f1 and 4.2.1f4.
What version are you running on - perhaps I've missed a version somewhere.
In any case, if you'd like to get running straight away while we resolve this, please edit the file (tk2dFontEditor.cs, line 160) and delete the lines as shown below.
bool IsTextureCompressed(Texture2D texture)
{
if (texture.format == TextureFormat.ARGB32
|| texture.format == TextureFormat.ARGB4444
#if !UNITY_3_5
|| texture.format == TextureFormat.RGBA4444
#endif
|| texture.format == TextureFormat.Alpha8
|| texture.format == TextureFormat.RGB24
|| texture.format == TextureFormat.RGB565
|| texture.format == TextureFormat.RGBA32)
{
return false;
}
else
{
return true;
}
}
Apologies for the inconvenience.
-
That's the fix I have actually used myself but wasn't sure what the consequences in the long run would be. :)
I am using 4.0.0f7.
-
No consequences, it looks like Unity only added this to the TextureFormat enum after 4.0.x, which is strange to say the least. It should work fine regardless even after you upgrade to a newer version of Unity.
You should replace the code with
#if !UNITY_3_5 && !UNITY_4_0 - thats what we've used. It looks like it works with every 4.x version after 4.0.x.
It'll be in the next update.
-
Thank you for your prompt help and for a great tool.