public bool Play(string AniName, string BackToAnim = "") { int index = -1; if (IsLoaded) { if (CurrentAnimation.ToLower() != AniName.ToLower()) { try { index = Animations.IndexOf(Animations.Single(a => a.Name.ToLower() == AniName.ToLower())); } catch { index = -1; } BackAnimation = null; if (!string.IsNullOrEmpty(BackToAnim)) { BackToAnimation(BackToAnim); } return(onPlayName(index, AniName)); } } return(false); }