Author Topic: Sprite Animations for Selection  (Read 2679 times)

Marckeeling

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Sprite Animations for Selection
« on: January 22, 2015, 12:31:15 PM »
Hi

I have made an animation of a 'selection bar' out of 15 frames.
When the user pushes down on the keyboard, the anim will play and stop on the last frame.

Ive played around with a few of the 2D animation scripts but having trouble working out the best one to use.

Ive attached an mp4 of what im trying to do, and the sprite sheet.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Sprite Animations for Selection
« Reply #1 on: January 22, 2015, 12:34:28 PM »
UI2DSpriteAnimation can do that for you. Choose the framerate, turn off looping, set the 2D sprites in order, and it will do the rest when you Play() it. If you don't want it to play on start, disable the script. Calling Play() will enable it automatically.

If you're using NGUI sprites instead of 2D sprites you can achieve the same thing using UISpriteAnimation instead.