コード例 #1
0
ファイル: SheetAnimMesh.cs プロジェクト: gsoec/lm-source
 // Token: 0x06002353 RID: 9043 RVA: 0x0040F5B0 File Offset: 0x0040D7B0
 public virtual void SampleAnimation(ESheetMeshAnim eAnim, float sampleTime)
 {
     this.PlayAnim(eAnim, SAWrapMode.Loop, false, false, false);
     this.IsPlaying    = false;
     this.m_DeltaTime += sampleTime;
     this.lastTime     = this.time;
     this.time        += sampleTime;
     if (this.m_DeltaTime >= 0.025f)
     {
         float num = (this.m_DeltaTime - 0.025f) * 40f;
         this.stepIndex += (int)num + 1;
         if (this.stepIndex > this.keyframeCount)
         {
             this.stepIndex -= this.keyframeCount;
             if (this.stepIndex > this.keyframeCount)
             {
                 this.stepIndex %= this.keyframeCount;
                 this.stepIndex  = Mathf.Max(this.stepIndex, 1);
             }
             this.time     = 0f;
             this.lastTime = 0f;
         }
         this.fixedDeltaTime  = this.m_DeltaTime - (0.025f + (float)((int)num) * 0.025f);
         this.m_DeltaTime     = this.fixedDeltaTime;
         this.meshShower.mesh = this.curAnimMesh[this.stepIndex - 1];
     }
 }
コード例 #2
0
ファイル: Lord.cs プロジェクト: gsoec/lm-source
 // Token: 0x06002380 RID: 9088 RVA: 0x00410A04 File Offset: 0x0040EC04
 public override void SampleAnimation(ESheetMeshAnim eAnim, float sampleTime)
 {
     if (this.animComponent != null)
     {
         this.animComponent.Stop();
         this.animComponent.CrossFade("idle");
     }
 }
コード例 #3
0
ファイル: SheetAnimMesh.cs プロジェクト: gsoec/lm-source
 // Token: 0x06002354 RID: 9044 RVA: 0x0040F6E0 File Offset: 0x0040D8E0
 public virtual void Update(float delteTime)
 {
     if (!this.IsPlaying)
     {
         return;
     }
     delteTime        *= this.speed;
     this.m_DeltaTime += delteTime;
     this.lastTime     = this.time;
     this.time        += delteTime;
     if (this.m_DeltaTime >= 0.025f)
     {
         float num = (this.m_DeltaTime - 0.025f) * 40f;
         this.stepIndex += (int)num + 1;
         if (this.stepIndex > this.keyframeCount)
         {
             if (this.playMode != SAWrapMode.Loop)
             {
                 if (this.playMode == SAWrapMode.Once)
                 {
                     this.meshShower.mesh = this.curAnimMesh[this.keyframeCount - 1];
                     this.IsPlaying       = false;
                     if (this.animNotify != null)
                     {
                         this.animNotify(this.curAnim);
                     }
                     return;
                 }
                 if (this.playMode == SAWrapMode.Default)
                 {
                     ESheetMeshAnim finishAnim = this.curAnim;
                     this.PlayAnim(ESheetMeshAnim.idle, SAWrapMode.Loop, true, false, false);
                     if (this.animNotify != null)
                     {
                         this.animNotify(finishAnim);
                     }
                 }
             }
             else
             {
                 ESheetMeshAnim esheetMeshAnim = this.curAnim;
                 this.stepIndex -= this.keyframeCount;
                 if (this.stepIndex > this.keyframeCount)
                 {
                     this.stepIndex %= this.keyframeCount;
                     this.stepIndex  = Mathf.Max(this.stepIndex, 1);
                 }
                 this.time     = 0f;
                 this.lastTime = 0f;
             }
         }
         this.fixedDeltaTime  = this.m_DeltaTime - (0.025f + (float)((int)num) * 0.025f);
         this.m_DeltaTime     = this.fixedDeltaTime;
         this.meshShower.mesh = this.curAnimMesh[this.stepIndex - 1];
     }
 }
コード例 #4
0
ファイル: Lord.cs プロジェクト: gsoec/lm-source
 // 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);
 }
コード例 #5
0
ファイル: Soldier.cs プロジェクト: gsoec/lm-source
 // Token: 0x0600236A RID: 9066 RVA: 0x0040FECC File Offset: 0x0040E0CC
 public void AnimOnceNotify(ESheetMeshAnim finishAnim)
 {
     if (finishAnim == ESheetMeshAnim.die)
     {
         this.DieState = 1;
     }
     else if (this.CurFSM == EStateName.MELEE_FIGHT_IMMEDIATE)
     {
         this.FSMController = FSMManager.Instance.getState(EStateName.TRYFIGHT);
     }
     else if (this.SoldierKind == 4 && finishAnim == ESheetMeshAnim.attack && this.Parent != null)
     {
         int sceneLightmapSize = LightmapManager.Instance.SceneLightmapSize;
         int curLightmapIdx    = 2 + sceneLightmapSize;
         this.Parent.resetLightmap(curLightmapIdx);
     }
 }
コード例 #6
0
ファイル: SheetAnimMesh.cs プロジェクト: gsoec/lm-source
 // 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);
 }
コード例 #7
0
ファイル: BrokenFO.cs プロジェクト: gsoec/lm-source
 // Token: 0x060022C7 RID: 8903 RVA: 0x0040B15C File Offset: 0x0040935C
 public void AnimOnceNotify(ESheetMeshAnim finishAnim)
 {
     this.transform.gameObject.SetActive(false);
 }