Open capitaljmedia opened 12 years ago
Try updating your project and see if the problems still occur, since a lot of updates has been done regarding texts.
This actually just started with the new updates, I updated my UIToolkit a few days ago and since then have had these text problems. Try out the test scene that comes with the toolkit and try changing the text in a text instance a few times to see what happens.
yah i was facing this problem too. i dont know y when we change text it basically remove all sprites in code but it didnot so now i am using textinstance.clear() function before updating text and its working fine... :)
Once a text instance has clear() called on it, the text can still be changed but it can no longer be animated. I tried this in the demo scene to make sure it wasn't something in my game code. If you try to enter new text to one of the text instances in the IEnumerator modifyTextInstances() method after the text instance is cleared and then try to animate it with a PositionTo then this error comes up:
MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object. UnityEngine.Transform.TransformPoint (Vector3 position) UISprite.updateTransform () (at Assets/Plugins/UIToolkit/BaseElements/UISprite.cs:311) UISprite.transformChanged () (at Assets/Plugins/UIToolkit/BaseElements/UISprite.cs:220)
The reason I was trying this out is because changing text in this latest UIToolKit build seems to not remove the pervious text in the text instance. So if I do this:
text1.text = "long test"; text1.text = "short";
the result is:
shorttest
or a jumble of both texts in the same space.