Beispiel #1
0
 private void OnAnimationLooped(object sender, AnimationLoopedEventArgs e)
 {
     if (m_hasTimeline)
     {
         m_playableDirector.set_time(0.0);
         m_playableDirector.Resume();
     }
 }
        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);
                }
            }
        }