2D Toolkit 2.0 is data-compatible with 2D Toolkit 1.x, but not entirely API compatible. We found this the right time to update some of the APIs. You will be able to use most if not all of your assets and scenes without any modifications. You will, however, be required to update your scripts appropriately to work with the new API.
Before upgrading, please ensure that your project runtime isn't corrupt. You can verify this by running the 2D Toolkit Integrity Checker.
If you use PlayMaker or other Unity middleware that depends on 2D Toolkit, ensure that these have been updated to work with 2D Toolkit 2.0 before you migrate to this version.
If you have moved the source files from the default installation directories, it is highly recommended to move them back to the default installation directory.
IMPORTANT: Make a backup of your project before updating.
While we have taken a lot of care in making 2D Toolkit data compatible, there are certain smaller less-used features which may be incompatible depending on how you have used it in your project. These features are listed here - please keep an eye out for irregularities with these, and fix them appropriately.
The static sprite batcher had numerous small bugs to do with hierarchy reconstruction which has been corrected in 2D Toolkit 2.0. This may cause different behaviours when your static sprite batcher is rebuilt, either due to a manual rebuild or an automatic build at scene load.
The potential incompatibility may only occur when you set up a hierarchy in the static sprite batcher, and the batcher itself AND other objects within it are scaled.
The sliced sprite used to have a "legacy mode" for backwards compatibility with 2D Toolkit 1.70 and earlier. There is an automatic upgrade process that is executed when a legacy sliced sprite is loaded for the first time, but there are certain cases where this may fail.
When operating in "legacy mode" the sliced sprite used the anchor set up in the sprite collection as the anchor for the sprite. The automatic migration is capable of upgrading all the preset anchor positions, but will fail when using a custom anchor in the sprite collection settings.
tk2dButton is now deprecated, but is still there in the distribution. Use tk2dUI instead, its much more powerful and flexible.
tk2dBaseSprite.SwitchCollectionAndSprite is now removed. You can use tk2dBaseSprite.SetSprite to achieve the same thing. You can safely find and replace all occurances of SwitchCollectionAndSprite to SetSprite.
tk2dBaseSprite.FlipX() and FlipY() are removed, and replaced with properties. You can now do things like sprite.FlipX = true; You should change all occurances of FlipX() to sprite.FlipX = !sprite.FlipX; to get the old "toggle" behaviour back.
Removed "Always pixel perfect" from sprites & textMeshes. This isn't necessary for operation, and can be called manually if still required.
tk2dAnimatedSprite is now deprecated, and replaced with tk2dSpriteAnimator. tk2dSpriteAnimator now attaches to a sprite type, and can animate all sprite types - including sliced sprites, tiled sprites, etc. All currently existing tk2dAnimatedSprites simply work - it now acts as a wrapper to tk2dSpriteAnimator, but some functions have been removed.
Migrating from tk2dAnimatedSprite to tk2dSpriteAnimator on a sprite.
tk2dRuntime.SpriteCollectionSize now replaced with tk2dSpriteCollectionSize. Other systems (sprite collection, font) will be migrated over to this new system in the future, but the changes will be versioned.
tk2dUIManager.OnMouseWheelChange has been changed to tk2dUIManager.OnScrollWheelChange. Unity was complaining about the OnMouse... function name when built to iOS.
Building a static sprite batcher in code - use batchedSprites.relativeMatrix.SetTRS( position, rotation, scale ); instead of batchedSprites.position.
Run the 2D Toolkit Integrity Checker to ensure the runtime scripts are not corrupt. If it is corrupt, do not proceed. Contact support for more information on how to update.
Create a new scene in Unity.
Import the 2D Toolkit 2.0 unitypackage.
IMPORTANT Restart Unity.
If you have previously used the "Setup for JS" command, run it again now. Files will be moved to appropriate locations.
Fix up all code incompatibilites as outlined above.
Check that you are not affected by the data incompatibility.
With a bit of luck, your project should now be running on 2D Toolkit 2.0.