// Token: 0x06003CBB RID: 15547 RVA: 0x000D91F8 File Offset: 0x000D73F8 private static void DefaultArray(string test, ref global::LightStyle[] array) { if (array == null) { global::LightStyle lightStyle = test; if (lightStyle) { array = new global::LightStyle[] { lightStyle }; } else { array = new global::LightStyle[0]; } } else if (array.Length == 0) { global::LightStyle lightStyle2 = test; if (lightStyle2) { array = new global::LightStyle[] { lightStyle2 }; } } }
// Token: 0x06003B5D RID: 15197 RVA: 0x000D2568 File Offset: 0x000D0768 public bool Blend(global::LightStyle style, float targetWeight, float fadeLength) { if (fadeLength <= 0f) { this.Play(style); return(true); } targetWeight = Mathf.Clamp01(targetWeight); if (style == this._lightStyle) { float num2; float num = this.CalculateSumWeight(true, out num2); if (Mathf.Approximately(1f - num, targetWeight)) { return(true); } float num3 = Mathf.MoveTowards(num, 1f - targetWeight, Time.deltaTime / fadeLength); if (num3 <= 0f) { foreach (global::LightStylist.Clip clip in this.clips.Values) { clip.weight = 0f; } } else { float num4 = num3 / num; foreach (global::LightStylist.Clip clip2 in this.clips.Values) { clip2.weight *= num4; } } } else { global::LightStylist.Clip orMakeClip = this.GetOrMakeClip(style); if (Mathf.Approximately(orMakeClip.weight, targetWeight)) { return(true); } orMakeClip.weight = Mathf.MoveTowards(orMakeClip.weight, targetWeight, Time.deltaTime / fadeLength); float num6; float num5 = this.CalculateSumWeight(false, out num6); if (num5 != orMakeClip.weight && num5 > 1f) { float num7 = num5 - orMakeClip.weight; foreach (global::LightStylist.Clip clip3 in this.clips.Values) { if (clip3 != orMakeClip) { clip3.weight /= num7; clip3.weight *= 1f - orMakeClip.weight; } } } } return(false); }
// Token: 0x06003B59 RID: 15193 RVA: 0x000D2318 File Offset: 0x000D0518 private global::LightStylist.Clip GetOrMakeClip(global::LightStyle style) { global::LightStylist.Clip clip; if (this.clips.TryGetValue(style, out clip)) { return(clip); } clip = new global::LightStylist.Clip(); clip.simulation = style.CreateSimulation(global::LightStyle.time, this); this.clips[style] = clip; return(clip); }
// Token: 0x06003B60 RID: 15200 RVA: 0x000D27DC File Offset: 0x000D09DC public bool CrossFade(global::LightStyle style, float fadeLength) { if (this.crossfadeThisFrame != style) { this.crossfadeThisFrame = style; this.crossfadeNextFrame = null; this.crossfadeLength = fadeLength; if (this.Blend(style, 1f, fadeLength)) { this.CrossFadeDone(); return(true); } } return(false); }
// Token: 0x06003B5B RID: 15195 RVA: 0x000D23C8 File Offset: 0x000D05C8 public void Play(global::LightStyle style) { if (style == this._lightStyle) { this.clips.Clear(); } else { global::LightStylist.Clip orMakeClip = this.GetOrMakeClip(style); this.clips.Clear(); this.clips[style] = orMakeClip; orMakeClip.weight = 1f; orMakeClip.simulation.ResetTime(global::LightStyle.time); } }
// Token: 0x06003B61 RID: 15201 RVA: 0x000D282C File Offset: 0x000D0A2C public bool CrossFade(global::LightStyle style) { return(this.CrossFade(style, 0.3f)); }
// Token: 0x06003B5F RID: 15199 RVA: 0x000D27C8 File Offset: 0x000D09C8 public bool Blend(global::LightStyle style) { return(this.Blend(style, 1f, 0.3f)); }
// Token: 0x06003B5E RID: 15198 RVA: 0x000D27B8 File Offset: 0x000D09B8 public bool Blend(global::LightStyle style, float targetWeight) { return(this.Blend(style, targetWeight, 0.3f)); }