Hello Guest

Author Topic: [Solved] How to swap "Anim Lib"  (Read 21251 times)

christianboutin

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 1
    • View Profile
[Solved] How to swap "Anim Lib"
« 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");