public void SetAnim(String newAnim) { if (AnimName != newAnim) { for (int i = 0; i < charDef.GetAnimationArray().Length; i++) { if (charDef.GetAnimation(i).Name == newAnim) { Anim = i; AnimFrame = 0; AnimName = newAnim; time = 0; Texture = Textures[charDef.GetAnimation(i).GetKeyFrame(0).Frame]; } } } }
public void SetAnim(String newAnim) { if (AnimationName != newAnim) { for (int i = 0; i < characterDefinition.GetAnimationArray().Length; i++) { if (characterDefinition.GetAnimation(i).Name == newAnim) { Anim = i; AnimationFrame = 0; AnimationName = newAnim; time = 0; if (ActorCollection <Actor> .TexturesLoaded) // only if the textures were loaded { Texture = ActorCollection <Actor> .Textures[characterDefinition.GetAnimation(i).GetKeyFrame(0).Frame]; } } } } }