I am extremely new to unity and just started working on my first project. I was wondering if there is a possibility to change sprites used in an animation via script instead of doing it by hand.
Example of a pseudocode
Sprite[] animSr = new Sprite[2]{SpriteA, SpriteB};
int animSampleRate = 60;
int[] framesIndex = new int[2]{ 0, 60};
Animation anim = new Animation();
//pseudocode
anim.SetSampleRate(animSampleRate);
anim.UpdateFrame(Sprite = animSr[0], FrameInd = framesIndex[0]);
anim.UpdateFrame(Sprite = animSr[1], FrameInd = framesIndex[1]);
so as a result anim should be an Animation like that