1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| private void Update() { if (this.prevIsTalking != this.isTalking) { this.prevIsTalking = this.isTalking; if (this.broadcast) this.TalkStatusChanged(); } if ((double) this.average < (double) this.saySmallTrigger) { this.say = "Rest"; this.sayIndex = 0; this.saySmallValue = SalsaUtility.LerpRangeOfMotion(this.saySmallValue, this.blendSpeed, this.rangeOfMotion, SalsaUtility.BlendDirection.Decrement); this.sayMediumValue = SalsaUtility.LerpRangeOfMotion(this.sayMediumValue, this.blendSpeed, this.rangeOfMotion, SalsaUtility.BlendDirection.Decrement); this.sayLargeValue = SalsaUtility.LerpRangeOfMotion(this.sayLargeValue, this.blendSpeed, this.rangeOfMotion, SalsaUtility.BlendDirection.Decrement); } else if ((double) this.average < (double) this.sayMediumTrigger) { this.say = "Small"; this.sayIndex = 1; this.saySmallValue = SalsaUtility.LerpRangeOfMotion(this.saySmallValue, this.blendSpeed, this.rangeOfMotion, SalsaUtility.BlendDirection.Increment); this.sayMediumValue = SalsaUtility.LerpRangeOfMotion(this.sayMediumValue, this.blendSpeed, this.rangeOfMotion, SalsaUtility.BlendDirection.Decrement); this.sayLargeValue = SalsaUtility.LerpRangeOfMotion(this.sayLargeValue, this.blendSpeed, this.rangeOfMotion, SalsaUtility.BlendDirection.Decrement); } else if ((double) this.average < (double) this.sayLargeTrigger) { this.say = "Medium"; this.sayIndex = 2; this.saySmallValue = SalsaUtility.LerpRangeOfMotion(this.saySmallValue, this.blendSpeed, this.rangeOfMotion, SalsaUtility.BlendDirection.Decrement); this.sayMediumValue = SalsaUtility.LerpRangeOfMotion(this.sayMediumValue, this.blendSpeed, this.rangeOfMotion, SalsaUtility.BlendDirection.Increment); this.sayLargeValue = SalsaUtility.LerpRangeOfMotion(this.sayLargeValue, this.blendSpeed, this.rangeOfMotion, SalsaUtility.BlendDirection.Decrement); } else { this.say = "Large"; this.sayIndex = 3; this.saySmallValue = SalsaUtility.LerpRangeOfMotion(this.saySmallValue, this.blendSpeed, this.rangeOfMotion, SalsaUtility.BlendDirection.Decrement); this.sayMediumValue = SalsaUtility.LerpRangeOfMotion(this.sayMediumValue, this.blendSpeed, this.rangeOfMotion, SalsaUtility.BlendDirection.Decrement); this.sayLargeValue = SalsaUtility.LerpRangeOfMotion(this.sayLargeValue, this.blendSpeed, this.rangeOfMotion, SalsaUtility.BlendDirection.Increment); } this.sayAmount.saySmall = this.saySmallValue; this.sayAmount.sayMedium = this.sayMediumValue; this.sayAmount.sayLarge = this.sayLargeValue; if ((bool) ((Object) this.skinnedMeshRenderer)) { this.skinnedMeshRenderer.SetBlendShapeWeight(this.saySmallIndex, this.sayAmount.saySmall); this.skinnedMeshRenderer.SetBlendShapeWeight(this.sayMediumIndex, this.sayAmount.sayMedium); this.skinnedMeshRenderer.SetBlendShapeWeight(this.sayLargeIndex, this.sayAmount.sayLarge); } if (!(bool) ((Object) this.audioSrc)) return; if (this.audioSrc.isPlaying) this.isTalking = true; else this.isTalking = false; }
|