private void Complete() { AnimatedValue = _to; Update?.Invoke(this, EventArgs.Empty); AnimationEnd?.Invoke(this, EventArgs.Empty); }
private IEnumerator End(float time) { float timer = 0; while (timer < time) { timer += Time.deltaTime; yield return(null); } AnimationEnd?.Invoke(); }
private void FinalizeAnimation() { if (this.Log().IsEnabled(Microsoft.Extensions.Logging.LogLevel.Debug)) { this.Log().DebugFormat("Finalizing animation for GPU Float value animator on property {0}.", _bindingPath.LastOrDefault().PropertyName); } if (_valueAnimator.IsRunning) { _valueAnimator.Cancel(); } AnimationEnd?.Invoke(this, EventArgs.Empty); ReleaseCoreAnimation(); }
public void Update() { float t = (Time.time - _startTime) / DestroyTime; if (t <= 1.0f) { _tr.localScale = Vector2.Lerp(_startScale, DestinationScale, t); } else { _tr.localScale = _startScale; Destroy(this); AnimationEnd?.Invoke(); } }
protected void OnFrame(object sender, object e) { var elapsed = _elapsed.ElapsedMilliseconds; if (elapsed < StartDelay) { // We got an invalid tick ... handle it gracefully // Reconfigure the start interval to tick only at the end of the start delay ConfigureStartInterval(elapsed); CurrentPlayTime = 0; _currentValue = _from; } else if (elapsed >= StartDelay + Duration) { IsRunning = false; DisableFrameReporting(); _elapsed.Stop(); CurrentPlayTime = Duration; _currentValue = _to; Update?.Invoke(this, EventArgs.Empty); AnimationEnd?.Invoke(this, EventArgs.Empty); } else { if (_isDelaying) { ConfigureAnimationInterval(); } var frame = elapsed - StartDelay; var value = GetUpdatedValue(frame, _from, _to); CurrentPlayTime = elapsed; _currentValue = value; Update?.Invoke(this, EventArgs.Empty); } }
public void EggMove(object sender, EventArgs e) { if (_currentFrame == FallFrameIndex) { ReadyToCatch?.Invoke(this, new EventArgs()); } if (_currentFrame == EndOfWayIndex) { TimerStop?.Invoke(this, new EventArgs()); timer.Stop(); AnimationEnd?.Invoke(this, new EventArgs()); return; } EggsDeactivate(); EggWay[_currentFrame].Visibility = Visibility.Visible; _currentFrame++; }
public void OnAnimationEnd(Animator animation) { AnimationEnd?.Invoke(Context, new AnimatorEventArgs(animation)); }
/// <summary> /// Ejecuta una serie de acciones /// </summary> internal void Execute(TimeLineModel timeLine) { // Crea el storyboard de las animaciones if (sbStoryBoard == null) { // Crea el storyBoard sbStoryBoard = new Storyboard(); // Asigna el evento de fin de animación sbStoryBoard.Completed += (sender, evntArgs) => AnimationEnd?.Invoke(this, EventArgs.Empty); } // Limpia el storyBoard sbStoryBoard.Children.Clear(); // Asigna las propiedades de duración sbStoryBoard.BeginTime = TimeSpan.FromSeconds(timeLine.Parameters.Start); sbStoryBoard.Duration = new Duration(TimeSpan.FromSeconds(timeLine.Parameters.Duration)); // Recorre las acciones añadiéndolas al storyboard foreach (ActionBaseModel action in timeLine.Actions) { if (action != null) { FrameworkElement control = PageView.GetPageControl(action.TargetKey); // Ejecuta la acción if (control != null) // && control.RenderTransform is TransformGroup) { if (action is SetVisibilityActionModel) { ExecuteVisibility(control, action as SetVisibilityActionModel); } else if (action is ResizeActionModel) { ExecuteResize(timeLine, control, action as ResizeActionModel); } else if (action is RotateActionModel) { ExecuteRotation(control, action as RotateActionModel); } else if (action is ZoomActionModel) { ExecuteZoom(control, action as ZoomActionModel); } else if (action is TranslateActionModel) { ExecuteTranslate(control, action as TranslateActionModel); } else if (action is PathActionModel) { ExecutePathAnimation(control, action as PathActionModel); } else if (action is SetZIndexModel) { ExecuteZIndexAnimation(control, action as SetZIndexModel); } else if (action is BrushViewBoxActionModel) { ExecuteViewBoxAnimation(control, action as BrushViewBoxActionModel); } else if (action is BrushRadialActionModel) { ExecuteBrushRadial(control, action as BrushRadialActionModel); } else if (action is BrushLinearActionModel) { ExecuteBrushLinear(control, action as BrushLinearActionModel); } } } } // Inicia la animación if (sbStoryBoard.Children.Count > 0) { // Lanza el evento de inicio de animación AnimationStart?.Invoke(this, EventArgs.Empty); // Arranca la animación sbStoryBoard.Begin(); } }
public void OnAnimationEnd(Animation animation) { AnimationEnd?.Invoke(animation); }
protected void OnAnimationEnd() { AnimationEnd?.Invoke(this, EventArgs.Empty); }