- Home /
Question by
RyuMaster · Mar 20, 2014 at 05:42 PM ·
animationspriteanimationcurve
Create 2D animation from Editor
Hi! I want to create animation from sprites dynamically; I've tried something like this:
AnimationClip _clip = new AnimationClip();
AnimationCurve _curve = new AnimationCurve();
Keyframe _key = new Keyframe(0,1f);
_curve.AddKey(_key);
_clip.SetCurve("", typeof(SpriteRenderer), "Sprite", _curve);
_clip.name = "TestAnimation";
_clip.wrapMode = WrapMode.Loop;
AssetDatabase.CreateAsset(_clip, "Assets/Test/MyAnim.anim");
AssetDatabase.SaveAssets();
But I can see, that original sprite anim files are in YAML format, an I get something different. Am I on the right path? Any hints?
Comment
Your answer
Follow this Question
Related Questions
Crushy Bird Game Doubt 1 Answer
Custom Pivot Points in Sprite Editor 1 Answer
Interrupting an animation cycle in Unity2D 1 Answer
Animating multiple 2D box colliders 1 Answer
Wrong Texture when make IOS build 0 Answers