public string PlayAnimation(string animName, float speed, bool loop, bool isFlipX = false) { if (string.IsNullOrEmpty(animName) || currentAnimPlayingName == animName && isFlipX == _animationService.IsFlipX) { //do nothing } else { if (_animationService != null) { currentAnimPlayingName = animName; _animationService.FlipX(isFlipX); _animationService.PlayAnimation(animName); _animationService.AnimationSpeed = speed; _animationService.IsAnimationLoop = loop; } } return(animName); }