Exemplo n.º 1
0
 // Token: 0x0600237E RID: 9086 RVA: 0x004106FC File Offset: 0x0040E8FC
 public override bool PlayAnim(ESheetMeshAnim eAnim, SAWrapMode mode = SAWrapMode.Loop, bool bRandomStartPoint = true, bool bForceReset = false, bool bBrokenFO = false)
 {
     if (!(this.animComponent != null))
     {
         return(false);
     }
     if (!bForceReset && this.lastAnim == ESheetMeshAnim.die)
     {
         return(false);
     }
     mode = ((eAnim != ESheetMeshAnim.die) ? mode : SAWrapMode.Once);
     this.animComponent[eAnim.ToString()].wrapMode = ((mode != SAWrapMode.Loop) ? WrapMode.Once : WrapMode.Loop);
     if (eAnim == ESheetMeshAnim.attack)
     {
         this.animComponent.CrossFade("idle");
     }
     if (eAnim == ESheetMeshAnim.die && this.IsLord && (!WarManager.IsNpcModeEnable || this.Parent == null || this.Parent.Side == 0))
     {
         this.animComponent.CrossFade("daze");
     }
     else if (eAnim == ESheetMeshAnim.attack && this.animComponent.IsPlaying("attack"))
     {
         AnimationState animationState = this.animComponent.CrossFadeQueued("attack", 0.3f, QueueMode.PlayNow);
         animationState.speed = ((this.attackAnimSpeedRate <= 0.001f) ? 1f : this.attackAnimSpeedRate);
         this.bCheckHitPoint  = true;
         this.lastTime        = 0f;
     }
     else
     {
         if (eAnim == ESheetMeshAnim.attack)
         {
             this.animComponent["attack"].speed = 1f;
             this.bCheckHitPoint = true;
             this.lastTime       = 0f;
         }
         if (eAnim == ESheetMeshAnim.die)
         {
             this.animComponent.CrossFade(eAnim.ToString(), 0.1f, PlayMode.StopAll);
         }
         else
         {
             this.animComponent.CrossFade(eAnim.ToString());
         }
     }
     this.lastAnim        = eAnim;
     this.bExtraScaleWork = true;
     return(true);
 }
Exemplo n.º 2
0
 // Token: 0x06002351 RID: 9041 RVA: 0x0040F400 File Offset: 0x0040D600
 public virtual bool PlayAnim(ESheetMeshAnim eAnim, SAWrapMode mode = SAWrapMode.Loop, bool bRandomStartPoint = true, bool bForceReset = false, bool bBrokenFO = false)
 {
     if (eAnim != this.curAnim || !this.IsPlaying || this.playMode != mode)
     {
         sAnimInfo sAnimInfo;
         if (!bBrokenFO)
         {
             sAnimInfo = SheetAnimInfo.Instance.getAnimInfo(this.m_ModelID, (ushort)eAnim);
         }
         else
         {
             sAnimInfo = SheetAnimInfo.Instance.getAnimFOInfo(this.m_ModelID);
         }
         if (sAnimInfo.animMesh != null)
         {
             this.keyframeCount   = sAnimInfo.keyframeCount;
             this.curAnimMesh     = sAnimInfo.animMesh;
             this.animLength      = sAnimInfo.animLength;
             this.m_DeltaTime     = 0f;
             this.time            = 0f;
             this.lastTime        = 0f;
             this.stepIndex       = ((!bRandomStartPoint) ? 1 : UnityEngine.Random.Range(1, (int)((float)this.keyframeCount * 0.5f)));
             this.meshShower.mesh = this.curAnimMesh[0];
             this.curAnim         = eAnim;
             this.playMode        = mode;
             this.IsPlaying       = true;
         }
         else
         {
             this.IsPlaying = false;
         }
         return(true);
     }
     if (bForceReset)
     {
         this.m_DeltaTime     = 0f;
         this.time            = 0f;
         this.lastTime        = 0f;
         this.stepIndex       = 1;
         this.meshShower.mesh = this.curAnimMesh[0];
         return(true);
     }
     return(false);
 }