public void AddClip(string name, string[] regionNames, float framesPerSecond, bool loop = true)
_animator.Update(gt); // Handle input, switch to "walk" clip when moving monogame sprite sheet
if (_currentClip == null) return; _elapsedTime += gameTime.ElapsedGameTime.TotalSeconds; if (_elapsedTime >= _currentClip.FrameDuration) _elapsedTime -= _currentClip.FrameDuration; _currentFrame++; if (_currentFrame >= _currentClip.RegionNames.Length) if (_currentClip.Loop) _currentFrame = 0; else _currentFrame = _currentClip.RegionNames.Length - 1; public void AddClip(string name
public void AddClip(string name, string[] regionNames, float framesPerSecond, bool loop = true)
_animator.Update(gt); // Handle input, switch to "walk" clip when moving
if (_currentClip == null) return; _elapsedTime += gameTime.ElapsedGameTime.TotalSeconds; if (_elapsedTime >= _currentClip.FrameDuration) _elapsedTime -= _currentClip.FrameDuration; _currentFrame++; if (_currentFrame >= _currentClip.RegionNames.Length) if (_currentClip.Loop) _currentFrame = 0; else _currentFrame = _currentClip.RegionNames.Length - 1;