public void PlayAnimation(Animation2 animation) { if (_animation == animation) return; this._animation = animation; this._frameIndex = 0; this._time = 0.0f; }
private static void SetMinionAnimations(LittleEnemy minion) { minion.DefaultState = "littleHipsterIdle"; Animation2 animation1 = new Animation2(); animation1.TextureName = "littleHipsterIdle"; animation1.IsLooping = true; animation1.FrameTime = 0.5f; minion.States.Add(animation1); Animation2 animation2 = new Animation2(); animation2.TextureName = "littleHipsterWalking"; animation2.IsLooping = true; animation2.FrameTime = 0.5f; minion.States.Add(animation2); }