public void AddNewAnimation(string name, Sprite[] sprites, bool loop = true) { if (animations == null) { animations = new UI2DAnimation[0]; } List <UI2DAnimation> temp = new List <UI2DAnimation>(); temp.AddRange(animations); UI2DAnimation newAnimation = new UI2DAnimation(); newAnimation.name = name; newAnimation.loop = loop; newAnimation.frames = sprites; temp.Add(newAnimation); animations = new UI2DAnimation[temp.Count]; animations = temp.ToArray(); }
public void AddNewAnimation( string name, Sprite[] sprites, bool loop = true ) { if( animations == null ) animations = new UI2DAnimation[0]; List<UI2DAnimation> temp = new List<UI2DAnimation>(); temp.AddRange( animations ); UI2DAnimation newAnimation = new UI2DAnimation(); newAnimation.name = name; newAnimation.loop = loop; newAnimation.frames = sprites; temp.Add(newAnimation); animations = new UI2DAnimation[temp.Count]; animations = temp.ToArray(); }