private void NextFrame() { CurrentFrame++; if (CurrentFrame != _totalFrames) { return; } CurrentFrame = 0; _isEnd = true; EndAnimation?.Invoke(); //EndAnimation = null; }
/// <summary> /// Ejecuta las acciones de una línea de tiempo /// </summary> internal void Execute(TimeLineModel timeLine) { // Si no existía ninguna animación se crea if (_animationProcessor == null) { // Crea el objeto _animationProcessor = new TimeLineProcessor(this, UseAnimation); // Asigna los manejadores de eventos _animationProcessor.AnimationStart += (sender, evntArgs) => { StartAnimation?.Invoke(this, EventArgs.Empty); IsPlayingAnimation = true; }; _animationProcessor.AnimationEnd += (sender, evntArgs) => { EndAnimation?.Invoke(this, EventArgs.Empty); IsPlayingAnimation = false; }; } // Ejecuta la animación _animationProcessor.Execute(timeLine); }
private static void AfterWakeUp() { EndAnimation.Invoke(); timer = new Timer(TimerCallback, "KissingTimer", TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(1)); rand = new System.Random(randSeed); }
protected virtual void OnEndAnimation(EventArgs e) { EndAnimation?.Invoke(this, e); }