コード例 #1
0
ファイル: Transition.cs プロジェクト: davidni/composition
        private void Animator_AnimationEnded(CompositionPropertyAnimator sender, AnimationEndedEventArgs args)
        {
            // Unregister from the event.

            sender.AnimationEnded -= Animator_AnimationEnded;


            // When an animator completes, remove it from the list of remaining animators and
            // Dispose() the animator.

            int index = _animators.IndexOf(sender);

            Debug.Assert(index >= 0);
            sender.Dispose();
            _animators.RemoveAt(index);


            // When no remaining animators, notify that the transition is complete.

            _runningAnimators--;
            if ((_runningAnimators == 0) && !_finished)
            {
                Debug.Assert(_animators.Count == 0);

                _finished = true;
                TransitionFinished(this);
            }
        }
コード例 #2
0
ファイル: Transition.cs プロジェクト: RudyChen/composition
        private void Animator_AnimationEnded(CompositionPropertyAnimator sender, AnimationEndedEventArgs args)
        {
            // Unregister from the event.

            sender.AnimationEnded -= Animator_AnimationEnded;


            // When an animator completes, remove it from the list of remaining animators and
            // Dispose() the animator.

            int index = _animators.IndexOf(sender);
            Debug.Assert(index >= 0);
            sender.Dispose();
            _animators.RemoveAt(index);


            // When no remaining animators, notify that the transition is complete.

            _runningAnimators--;
            if ((_runningAnimators == 0) && !_finished)
            {
                Debug.Assert(_animators.Count == 0);

                _finished = true;
                TransitionFinished(this);
            }
        }
コード例 #3
0
 void Ship_AnimationCompleted(object source, AnimationEndedEventArgs e)
 {
     if (e.Key == "Crash")
     {
         Ship.Visible = false;
     }
 }
コード例 #4
0
        private void ResetSourceAnimationEnded(object sender, AnimationEndedEventArgs e)
        {
            var callback = this.runningAnimations[sender as RadAnimation].Item2;

            this.runningAnimations.Remove(sender as RadAnimation);
            callback(null);
        }
コード例 #5
0
        private void OnItemAddedAnimation_Ended(object sender, AnimationEndedEventArgs e)
        {
            SingleItemAnimationContext context = this.GetAnimationContextForTarget(e.AnimationInfo.Target as RadVirtualizingDataControlItem, true);
            RadAnimation endedAnimation        = sender as RadAnimation;

            this.OnItemAddedAnimationEnded(endedAnimation, context);
        }
コード例 #6
0
		private void NewStageWindowOpened(object sender, AnimationEndedEventArgs e) {
			EventHandler<GestureEventArgs> handler = null;
			handler = (o, args) => {
				LayoutRoot.Tap -= handler;
				NewStageWindow.IsOpen = false;
			};
			LayoutRoot.Tap += handler;
		}
コード例 #7
0
ファイル: CarSystem.cs プロジェクト: rasch1/Space-Dinosaurs
 void AnimationCompleted(object source, AnimationEndedEventArgs e)
 {
     if (e.Key == "Crash")
     {
         CarObject.StartAnimation("Forward");
         _level.Status = RaceStatus.Running;
     }
 }
コード例 #8
0
 private void OnAnimationEnded(object sender, AnimationEndedEventArgs e)
 {
     if (m_animationStarted && e.animation.Equals(m_animationName))
     {
         m_onComplete?.Invoke();
         m_onComplete = null;
         m_onCancel   = null;
         m_onStart    = null;
     }
 }
コード例 #9
0
        private void CurrentItemAnimationEnded(object sender, AnimationEndedEventArgs e)
        {
            var animation = sender as RadAnimation;
            var item      = this.runningAnimations[animation].Item1;

            if (item is IAnimated)
            {
                (item as IAnimated).IsAnimating = false;
            }
            this.runningAnimations.Remove(animation);
        }
コード例 #10
0
ファイル: MainPage.xaml.cs プロジェクト: RudyChen/composition
        // Defines the event functionality when an animation complete.
        private void OnAnimationEnded(CompositionPropertyAnimator sender, AnimationEndedEventArgs eventArgs)
        {
            // For sample sake, explicitly looking for only one animation.
            if (sender == _animator)
            {
                ((ContainerVisual)_target.Parent).Children.Remove(_target);
                Debug.WriteLine("Animation Complete. Remove Visual from Tree");

                // Remove the registration for state event change
                sender.AnimationEnded -= OnAnimationEnded;
            }
        }
コード例 #11
0
ファイル: MainPage.xaml.cs プロジェクト: davidni/composition
        // Defines the event functionality when an animation complete.
        private void OnAnimationEnded(CompositionPropertyAnimator sender, AnimationEndedEventArgs eventArgs)
        {
            // For sample sake, explicitly looking for only one animation.
            if (sender == _animator)
            {
                ((ContainerVisual)_target.Parent).Children.Remove(_target);
                Debug.WriteLine("Animation Complete. Remove Visual from Tree");

                // Remove the registration for state event change
                sender.AnimationEnded -= OnAnimationEnded;
            }
        }
コード例 #12
0
        private void AnimationEndedOnAddedItem(object sender, AnimationEndedEventArgs e)
        {
            var animation = sender as RadAnimation;
            var callback  = this.runningAnimations[animation].Item2;
            var item      = this.runningAnimations[animation].Item1;

            if (item is IAnimated)
            {
                (item as IAnimated).IsAnimating = false;
            }

            this.runningAnimations.Remove(animation);
            callback(item);
        }
コード例 #13
0
        private void ItemRemovedAnimationEnded(object sender, AnimationEndedEventArgs e)
        {
            var callback = this.runningAnimations[sender as RadAnimation].Item2;

            if (this.scheduledModelsForRecycle.Count > 0)
            {
                var itemForRecycle = this.scheduledModelsForRecycle.First();
                itemForRecycle.IsAnimating = false;
                this.scheduledModelsForRecycle.Remove(itemForRecycle);

                if (this.runningAnimations.Keys.Count > 0)
                {
                    this.runningAnimations.Remove(sender as RadAnimation);
                }

                callback(itemForRecycle);
            }
        }
 private void RadAnimation_OnEnded(object sender, AnimationEndedEventArgs e)
 {
     InsufficientFundWindow.IsOpen = false;
 }
コード例 #15
0
 private void ForwardCheckModeAnimationEnded(object sender, AnimationEndedEventArgs e)
 {
     (sender as RadAnimation).Ended -= this.ForwardCheckModeAnimationEnded;
     this.Owner.itemCheckBoxService.itemsAnimated = true;
 }
コード例 #16
0
 private void BackwardsCheckModeAnimationEnded(object sender, AnimationEndedEventArgs e)
 {
     (sender as RadAnimation).Ended -= this.BackwardsCheckModeAnimationEnded;
     this.Owner.itemCheckBoxService.itemsAnimated = true;
     this.Owner.itemCheckBoxService.OnIsCheckModeActiveChanged();
 }
コード例 #17
0
ファイル: Tile.cs プロジェクト: davidni/composition
        private void RotationAngle_AnimationEnded(CompositionPropertyAnimator sender, AnimationEndedEventArgs args)
        {
            sender.AnimationEnded -= RotationAngle_AnimationEnded;

            StartNewRotationAnimation();
        }
コード例 #18
0
        private void LateUpdate()
        {
            //IL_0024: Unknown result type (might be due to invalid IL or missing references)
            //IL_002a: Invalid comparison between Unknown and I4
            //IL_006f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0076: Expected O, but got Unknown
            //IL_00d8: Unknown result type (might be due to invalid IL or missing references)
            //IL_00df: Expected O, but got Unknown
            //IL_010b: Unknown result type (might be due to invalid IL or missing references)
            //IL_0112: Expected O, but got Unknown
            AnimationClip currentAnimation = m_currentAnimation;

            if (null == currentAnimation)
            {
                return;
            }
            Animation controller = m_controller;

            if (controller.get_isPlaying())
            {
                if ((int)controller.get_wrapMode() != 2)
                {
                    if (reachedEndOfAnimation)
                    {
                        return;
                    }
                    string         name = currentAnimation.get_name();
                    AnimationState val  = m_controller.get_Item(name);
                    if (val.get_time() >= val.get_length())
                    {
                        reachedEndOfAnimation = true;
                        if (this.AnimationEnded != null)
                        {
                            AnimationEndedEventArgs val2 = new AnimationEndedEventArgs(name);
                            this.AnimationEnded.Invoke((object)this, val2);
                        }
                    }
                }
                else if (this.AnimationLooped != null)
                {
                    string         name2  = currentAnimation.get_name();
                    AnimationState obj    = m_controller.get_Item(name2);
                    float          time   = obj.get_time();
                    float          length = obj.get_length();
                    int            num    = (int)(Mathf.Max(0f, time - Time.get_deltaTime()) / length);
                    if ((int)(time / length) > num)
                    {
                        AnimationLoopedEventArgs val3 = new AnimationLoopedEventArgs(name2);
                        this.AnimationLooped.Invoke((object)this, val3);
                    }
                }
            }
            else if (!reachedEndOfAnimation)
            {
                reachedEndOfAnimation = true;
                if (this.AnimationEnded != null)
                {
                    AnimationEndedEventArgs val4 = new AnimationEndedEventArgs(currentAnimation.get_name());
                    this.AnimationEnded.Invoke((object)this, val4);
                }
            }
        }
コード例 #19
0
        private void OnItemRemovedAnimation_Ended(object sender, AnimationEndedEventArgs e)
        {
            SingleItemAnimationContext endedAnimation = this.GetAnimationContextForTarget(e.AnimationInfo.Target as RadVirtualizingDataControlItem, false);

            this.OnItemRemovedAnimationEnded(sender as RadAnimation, endedAnimation);
        }
コード例 #20
0
ファイル: Tile.cs プロジェクト: RudyChen/composition
        private void RotationAngle_AnimationEnded(CompositionPropertyAnimator sender, AnimationEndedEventArgs args)
        {
            sender.AnimationEnded -= RotationAngle_AnimationEnded;

            StartNewRotationAnimation();
        }
コード例 #21
0
        public void SetAnimation(string animName, bool animLoops, bool async = true, bool restart = true)
        {
            //IL_0078: Unknown result type (might be due to invalid IL or missing references)
            //IL_007e: Invalid comparison between Unknown and I4
            //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
            //IL_00ae: Expected O, but got Unknown
            //IL_018d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0193: Invalid comparison between Unknown and I4
            //IL_01c0: Unknown result type (might be due to invalid IL or missing references)
            //IL_01c7: Expected O, but got Unknown
            //IL_01e9: Unknown result type (might be due to invalid IL or missing references)
            //IL_01f0: Expected O, but got Unknown
            bool          reachedEndOfAnimation = this.reachedEndOfAnimation;
            AnimationClip currentAnimation      = m_currentAnimation;
            string        text;

            if (null != currentAnimation)
            {
                text = currentAnimation.get_name();
                if (text.Equals(animName))
                {
                    if (!restart)
                    {
                        return;
                    }
                    m_currentLabel = string.Empty;
                    AnimationState val = m_controller.get_Item(animName);
                    if (val.get_enabled())
                    {
                        val.set_time(0f);
                    }
                    else
                    {
                        m_controller.Play(animName, 4);
                    }
                    if ((int)m_controller.get_wrapMode() != 2)
                    {
                        this.reachedEndOfAnimation = Mathf.Approximately(0f, currentAnimation.get_length());
                        if (this.AnimationEnded != null && this.reachedEndOfAnimation)
                        {
                            AnimationEndedEventArgs val2 = new AnimationEndedEventArgs(animName);
                            this.AnimationEnded.Invoke((object)this, val2);
                        }
                    }
                    else
                    {
                        this.reachedEndOfAnimation = false;
                    }
                    return;
                }
            }
            else
            {
                text = string.Empty;
            }
            m_currentLabel = string.Empty;
            if (!m_controller.Play(animName, 4))
            {
                Log.Warning("Could not play animation named '" + animName + "' on GameObject named '" + this.get_name() + "'.", 479, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Animations\\FloorMechanismAnimator.cs");
                return;
            }
            AnimationState val3 = m_controller.get_Item(animName);

            if (null == val3)
            {
                Log.Warning("Could not play animation named '" + animName + "' on GameObject named '" + this.get_name() + "'.", 495, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Animations\\FloorMechanismAnimator.cs");
                return;
            }
            m_currentAnimation = val3.get_clip();
            if ((int)m_controller.get_wrapMode() != 2)
            {
                this.reachedEndOfAnimation = (val3.get_time() >= val3.get_length());
            }
            else
            {
                this.reachedEndOfAnimation = false;
            }
            if (this.AnimationStarted != null)
            {
                AnimationStartedEventArgs val4 = new AnimationStartedEventArgs(animName, text, 0);
                this.AnimationStarted.Invoke((object)this, val4);
            }
            if (this.AnimationEnded != null && this.reachedEndOfAnimation && !reachedEndOfAnimation)
            {
                AnimationEndedEventArgs val5 = new AnimationEndedEventArgs(animName);
                this.AnimationEnded.Invoke((object)this, val5);
            }
        }