Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by jugnu · Sep 11, 2016 at 05:19 PM · animation2d gameeditor-scripting

2d Sprite Animation Editor Scripting.

Hi, I am doing a 2d game which has more than 100 animation using sprites or Image animation. It has 36 small scenes and every scene will have atleast 4-5 animation. I was a cocos2d-x developer and migrated to Unity3d. Every time i have to make an animation i am dragging and dropping images in Animation panel.

Lets Assume i have a 24 image animation & i am adding a keyframe after every 5 miliseconds & picking images from a folder Texture/Car. This work is boring, monotonous and Could be easily done with Editor script. As all the variables are known. I just dont know how to look or access all this editor variables and generate animation clip.

Now what i want is if i am trying to make an animation on the image then i should be able to attach an editor script to it and give it source image folder address so that it can take all the images and give it miliseconds difference for each key frame addition. And it should save the animation clip on target folder with the specified name.

If someone could even direct me with the terms and terminology or basic editor script then i can modify it according to my need as this will save my 50 % of time which i can do for other things.

Thanks

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jugnu · Sep 21, 2016 at 11:34 PM 0
Share

hi @Adam-mechtley,

I got the answer in mail. But its not showing in Forum. Is it that i am doing something wrong.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Adam-Mechtley · Sep 22, 2016 at 07:59 AM

@jugnu nope! I actually removed my answer because I realized it wasn't what you were asking.

You'll of course have some validation and such based on how you're working, but the basic steps are something like:

  1. Create a new AnimationClip

  2. Get or create the EditorCurveBinding for your SpriteRenderer's m_Sprite property

  3. Use UnityEditor.AnimationUtility.SetObjectReferenceCurve() to set your sprite sequence on the clip using the binding you created in step 2 and the clip created in step 1

  4. Save your AnimationClip in the project (using e.g., AssetDatabase.CreateAsset() with your new clip created in step 1)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Play animation in the editor? 3 Answers

Starting a 2D animation on a trigger 1 Answer

How to add new curves or animation events to an imported animation? 6 Answers

Best new 2d tool to make a game like Zombieville ? 2 Answers

Animator Condition Not Working 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges