public override void Update(GameTime gameTime) { base.Update(gameTime); if (ActiveKeyFrame >= LoopEnd) { OnLoopEnd(); } for (int A = 0; A < ListActivePartialAnimation.Count; A++) { PartialAnimation ActivePartialAnimation = ListActivePartialAnimation[A]; ActivePartialAnimation.Update(gameTime); foreach (KeyValuePair <string, VisibleTimeline> ActiveObject in ActivePartialAnimation.DicInheritedObject) { if (ActiveObject.Value == null) { continue; } VisibleTimeline ActiveAnimationObject; DicActiveAnimationObject.TryGetValue(ActiveObject.Key, out ActiveAnimationObject); if (ActiveAnimationObject != null) { ActiveAnimationObject.Alpha = 0; } } if (ActivePartialAnimation.ActiveKeyFrame >= ActivePartialAnimation.LoopEnd) { OnPartialAnimationLoopEnd(ActivePartialAnimation); } } }
private void ClearPartialAnimation(PartialAnimation ActivePartialAnimation) { for (int L = 0; L < ActivePartialAnimation.ListAnimationLayer.Count; L++) { foreach (VisibleTimeline ActiveBitmap in ActivePartialAnimation.ListAnimationLayer[L].ListVisibleObject) { ActiveBitmap.OnDeathFrame(this); } foreach (MarkerTimeline ActiveMarker in ActivePartialAnimation.ListAnimationLayer[L].ListActiveMarker) { ActiveMarker.OnDeathFrame(this); } foreach (PolygonCutterTimeline ActivePolygonCutter in ActivePartialAnimation.ListAnimationLayer[L].ListPolygonCutter) { ActivePolygonCutter.OnDeathFrame(this); } ActivePartialAnimation.ListAnimationLayer[L].ResetAnimationLayer(); } ActivePartialAnimation.ActiveKeyFrame = ActivePartialAnimation.LoopStart; for (int F = 0; F < ActivePartialAnimation.ActiveKeyFrame; F++) { ActivePartialAnimation.UpdateKeyFrame(F); } }
protected void RemovePartialAnimation(PartialAnimation ActivePartialAnimation) { int Index = ListActivePartialAnimation.IndexOf(ActivePartialAnimation); if (Index >= 0) { ListActivePartialAnimation[Index].ActiveKeyFrame = ListActivePartialAnimation[Index].LoopStart; ListActivePartialAnimation.RemoveAt(Index); ListActivePartialAnimationName.RemoveAt(Index); } }
protected AnimationClass CreateAnimation(string AnimationName, bool IsPartialAnimation) { AnimationClass ActiveAnimation = null; if (IsPartialAnimation) { ActiveAnimation = new PartialAnimation(AnimationName, this); } else { ActiveAnimation = new AnimationClass(AnimationName); } ActiveAnimation.DicTimeline = DicTimeline; ActiveAnimation.LoadFromFile(); for (int A = ActiveAnimation.ListAnimationLayer.Count - 1; A >= 0; --A) { ActiveAnimation.ListAnimationLayer[A].Owner = this; } return(ActiveAnimation); }
protected virtual void OnPartialAnimationLoopEnd(PartialAnimation ActivePartialAnimation) { ClearPartialAnimation(ActivePartialAnimation); }