2D Toolkit Forum

2D Toolkit => FAQs => Topic started by: christianboutin on January 28, 2012, 04:10:30 pm

Title: [Solved] How to swap "Anim Lib"
Post by: christianboutin on January 28, 2012, 04:10:30 pm
Just doing a quick repost of the Q&A about Anim Lib in the 2D Toolkit thread on the Unity Forums in case people look for the solution over here:

Question was: How to swap "Anim Lib" with code.

Keep in mind that you should have the new animated sprite in a "resources" folder

Code: [Select]
sprite = GetComponent<tk2dAnimatedSprite>();
sprite.anim = (tk2dSpriteAnimation)Resources.Load ("new_anim_sprite_name", typeof(tk2dSpriteAnimation));
sprite.Play ("anim_clip_name");