Esempio n. 1
0
        private void DoPlay(PlayAnimParam param)
        {
            if (!this.bPausePlay)
            {
                if (param.blendTime > 0f)
                {
                    if (!param.loop)
                    {
                        AnimationState state = base.actor.ActorMeshAnimation.CrossFadeQueued(param.animName, param.blendTime, QueueMode.PlayNow);
                        if (state != null)
                        {
                            state.speed    = param.speed;
                            state.wrapMode = !param.loop ? WrapMode.ClampForever : WrapMode.Loop;
                        }
                    }
                    else
                    {
                        base.actor.ActorMeshAnimation.CrossFade(param.animName, param.blendTime);
                    }
                }
                else
                {
                    base.actor.ActorMeshAnimation.Stop();
                    base.actor.ActorMeshAnimation.Play(param.animName);
                }
                this.curAnimName          = param.animName;
                this.curAnimPlayFrameTick = Singleton <FrameSynchr> .GetInstance().LogicFrameTick;

                AnimationState state2 = base.actor.ActorMeshAnimation[param.animName];
                if (state2 != null)
                {
                    state2.wrapMode = !param.loop ? WrapMode.ClampForever : WrapMode.Loop;
                }
            }
        }
Esempio n. 2
0
 public void Play(PlayAnimParam param)
 {
     if (((base.actor.ActorMesh != null) && (base.actor.ActorMeshAnimation != null)) && (base.actor.ActorMeshAnimation.GetClip(param.animName) != null))
     {
         if (this.changeList.Count > 0)
         {
             this.ChangeAnimName(ref param);
         }
         if (param.cancelAll)
         {
             this.anims.Clear();
         }
         if (param.cancelCurrent && (this.anims.Count > 0))
         {
             this.anims.RemoveAt(this.anims.Count - 1);
         }
         for (int i = 0; i < this.anims.Count; i++)
         {
             PlayAnimParam param2 = this.anims[i];
             if (param2.layer == param.layer)
             {
                 this.anims.RemoveAt(i);
                 i--;
             }
         }
         this.anims.Add(param);
         bool flag = true;
         if (this.anims.Count > 1)
         {
             if (< > f__am$cache5 == null)
             {
        public void Play(PlayAnimParam param)
        {
            if (this.actor.ActorMesh == null || this.actor.ActorMeshAnimation == null)
            {
                return;
            }
            if (this.actor.ActorMeshAnimation.GetClip(param.animName) == null)
            {
                return;
            }
            if (this.changeList.get_Count() > 0)
            {
                this.ChangeAnimName(ref param);
            }
            if (param.cancelAll)
            {
                this.anims.Clear();
            }
            if (param.cancelCurrent && this.anims.get_Count() > 0)
            {
                this.anims.RemoveAt(this.anims.get_Count() - 1);
            }
            for (int i = 0; i < this.anims.get_Count(); i++)
            {
                if (this.anims.get_Item(i).layer == param.layer)
                {
                    this.anims.RemoveAt(i);
                    i--;
                }
            }
            this.anims.Add(param);
            bool flag = true;

            if (this.anims.get_Count() > 1)
            {
                this.anims.Sort(delegate(PlayAnimParam a, PlayAnimParam b)
                {
                    if (a.layer == b.layer)
                    {
                        return(0);
                    }
                    if (a.layer < b.layer)
                    {
                        return(-1);
                    }
                    return(1);
                });
                flag = (this.anims.get_Item(this.anims.get_Count() - 1).animName == param.animName);
            }
            if (flag)
            {
                this.DoPlay(param);
            }
        }
 private void ChangeAnimName(ref PlayAnimParam param)
 {
     for (int i = 0; i < this.changeList.get_Count(); i++)
     {
         ChangeAnimParam changeAnimParam = this.changeList.get_Item(i);
         if (changeAnimParam.originalAnimName == param.animName && this.actor.ActorMeshAnimation.GetClip(changeAnimParam.changedAnimName) != null)
         {
             param.animName = changeAnimParam.changedAnimName;
             return;
         }
     }
 }
Esempio n. 5
0
 private void ChangeAnimName(ref PlayAnimParam param)
 {
     for (int i = 0; i < this.changeList.Count; i++)
     {
         Assets.Scripts.GameLogic.ChangeAnimParam param2 = this.changeList[i];
         if ((param2.originalAnimName == param.animName) && (base.actor.ActorMeshAnimation.GetClip(param2.changedAnimName) != null))
         {
             param.animName = param2.changedAnimName;
             return;
         }
     }
 }
        private void ChangeCurAnimParam(ChangeAnimParam _param, bool bRecover)
        {
            string text     = bRecover ? _param.changedAnimName : _param.originalAnimName;
            string animName = bRecover ? _param.originalAnimName : _param.changedAnimName;

            for (int i = 0; i < this.anims.get_Count(); i++)
            {
                PlayAnimParam param = this.anims.get_Item(i);
                if (param.animName == text)
                {
                    string animName2 = param.animName;
                    param.animName = animName;
                    if (animName2 == this.curAnimName)
                    {
                        this.Play(param);
                    }
                }
            }
        }
Esempio n. 7
0
        private void ChangeCurAnimParam(Assets.Scripts.GameLogic.ChangeAnimParam _param, bool bRecover)
        {
            string str2 = !bRecover ? _param.originalAnimName : _param.changedAnimName;
            string str3 = !bRecover ? _param.changedAnimName : _param.originalAnimName;

            for (int i = 0; i < this.anims.Count; i++)
            {
                PlayAnimParam param = this.anims[i];
                if (param.animName == str2)
                {
                    string animName = param.animName;
                    param.animName = str3;
                    if (animName == this.curAnimName)
                    {
                        this.DoPlay(param);
                    }
                }
            }
        }
        private void DoPlay(PlayAnimParam param)
        {
            if (this.bPausePlay)
            {
                return;
            }
            if (param.blendTime > 0f)
            {
                if (!param.loop)
                {
                    AnimationState animationState = this.actor.ActorMeshAnimation.CrossFadeQueued(param.animName, param.blendTime, QueueMode.PlayNow);
                    if (animationState)
                    {
                        animationState.speed    = param.speed;
                        animationState.wrapMode = (param.loop ? WrapMode.Loop : WrapMode.ClampForever);
                    }
                }
                else
                {
                    this.actor.ActorMeshAnimation.CrossFade(param.animName, param.blendTime);
                }
            }
            else
            {
                this.actor.ActorMeshAnimation.Stop();
                this.actor.ActorMeshAnimation.Play(param.animName);
            }
            this.curAnimName          = param.animName;
            this.curAnimPlayFrameTick = Singleton <FrameSynchr> .GetInstance().LogicFrameTick;

            AnimationState animationState2 = this.actor.ActorMeshAnimation[param.animName];

            if (animationState2)
            {
                animationState2.wrapMode = (param.loop ? WrapMode.Loop : WrapMode.ClampForever);
            }
        }