public FigureMovementAnimationComponent(Entity referringEntity, Texture2D texture) : base(referringEntity) { var forward = Animation.CreateDiscrete(0.65f, new[] { texture.GetTexcoordsFromPixelCoords(0, 0), texture.GetTexcoordsFromPixelCoords(32, 0), texture.GetTexcoordsFromPixelCoords(0, 0), texture.GetTexcoordsFromPixelCoords(64, 0), }, OnUpdate, true); var left = Animation.CreateDiscrete(0.65f, new[] { texture.GetTexcoordsFromPixelCoords(0, 32), texture.GetTexcoordsFromPixelCoords(32, 32), texture.GetTexcoordsFromPixelCoords(0, 32), texture.GetTexcoordsFromPixelCoords(64, 32), }, OnUpdate, true); var right = Animation.CreateDiscrete(0.65f, new[] { texture.GetTexcoordsFromPixelCoords(0, 96), texture.GetTexcoordsFromPixelCoords(32, 96), texture.GetTexcoordsFromPixelCoords(0, 96), texture.GetTexcoordsFromPixelCoords(64, 96), }, OnUpdate, true); var backward = Animation.CreateDiscrete(0.65f, new[] { texture.GetTexcoordsFromPixelCoords(0, 64), texture.GetTexcoordsFromPixelCoords(32, 64), texture.GetTexcoordsFromPixelCoords(0, 64), texture.GetTexcoordsFromPixelCoords(64, 64), }, OnUpdate, true); AddAnimation(ForwardAnimation, forward); AddAnimation(BackwardAnimation, backward ?? forward); AddAnimation(LeftAnimation, left ?? forward); AddAnimation(RightAnimation, right ?? forward); }