// Token: 0x06003B1E RID: 15134 RVA: 0x000D12E8 File Offset: 0x000CF4E8
 public static global::LightStyle.Mod operator *(global::LightStyle.Mod a, float b)
 {
     global::LightStyle.Mod result = a;
     for (global::LightStyle.Mod.Element element = global::LightStyle.Mod.Element.Red; element < (global::LightStyle.Mod.Element) 7; element++)
     {
         if ((a.mask & global::LightStyle.Mod.ElementToMask(element)) == global::LightStyle.Mod.ElementToMask(element))
         {
             result.SetFaceValue(element, a.GetFaceValue(element) * b);
         }
     }
     return(result);
 }
 // Token: 0x06003B0D RID: 15117 RVA: 0x000D0EE8 File Offset: 0x000CF0E8
 public static global::LightStyle.Mod operator +(global::LightStyle.Mod a, global::LightStyle.Mod b)
 {
     global::LightStyle.Mod      result = a;
     global::LightStyle.Mod.Mask mask   = a.mask & b.mask;
     for (global::LightStyle.Mod.Element element = global::LightStyle.Mod.Element.Red; element < (global::LightStyle.Mod.Element) 7; element++)
     {
         if ((mask & global::LightStyle.Mod.ElementToMask(element)) == global::LightStyle.Mod.ElementToMask(element))
         {
             result.SetFaceValue(element, a.GetFaceValue(element) + b.GetFaceValue(element));
         }
     }
     return(result);
 }
 // Token: 0x06003B0C RID: 15116 RVA: 0x000D0E18 File Offset: 0x000CF018
 public static global::LightStyle.Mod Lerp(global::LightStyle.Mod a, global::LightStyle.Mod b, float t, global::LightStyle.Mod.Mask mask)
 {
     b.mask &= mask;
     if (b.mask == (global::LightStyle.Mod.Mask) 0)
     {
         return(a);
     }
     a.mask &= mask;
     if (a.mask == (global::LightStyle.Mod.Mask) 0)
     {
         return(b);
     }
     global::LightStyle.Mod.Mask mask2 = a.mask & b.mask;
     if (mask2 != (global::LightStyle.Mod.Mask) 0)
     {
         float num = 1f - t;
         if (mask != (global::LightStyle.Mod.Mask) 0)
         {
             for (global::LightStyle.Mod.Element element = global::LightStyle.Mod.Element.Red; element < (global::LightStyle.Mod.Element) 7; element++)
             {
                 if ((mask2 & global::LightStyle.Mod.ElementToMask(element)) == global::LightStyle.Mod.ElementToMask(element))
                 {
                     float faceValue  = a.GetFaceValue(element);
                     float faceValue2 = b.GetFaceValue(element);
                     float value      = faceValue * num + faceValue2 * t;
                     a.SetFaceValue(element, value);
                 }
             }
         }
     }
     if (mask2 != a.mask)
     {
         a |= b;
     }
     return(a);
 }
    // Token: 0x06003B54 RID: 15188 RVA: 0x000D1E5C File Offset: 0x000D005C
    protected void LateUpdate()
    {
        if (this.crossfadeThisFrame)
        {
            this.crossfadeNextFrame = this.crossfadeThisFrame;
            this.crossfadeThisFrame = null;
        }
        else if (this.crossfadeNextFrame && !this.CrossFade(this.crossfadeNextFrame, this.crossfadeLength))
        {
            this.crossfadeNextFrame = this.crossfadeThisFrame;
            this.crossfadeThisFrame = null;
        }
        float num2;
        float num = this.CalculateSumWeight(true, out num2);

        global::LightStyle.Mod a;
        if (num == 0f)
        {
            while (this.clipsInSortingArray > 0)
            {
                this.sortingArray[--this.clipsInSortingArray] = null;
            }
            if (!this._lightStyle)
            {
                return;
            }
            a = this.simulationIdle.BindMod(this._mask);
        }
        else
        {
            int count = this.clips.Count;
            if (this.clipsInSortingArray != count)
            {
                if (this.clipsInSortingArray > count)
                {
                    while (this.clipsInSortingArray > count)
                    {
                        this.sortingArray[--this.clipsInSortingArray] = null;
                    }
                }
                else if (this.sortingArray == null || this.sortingArray.Length < count)
                {
                    Array.Resize <global::LightStylist.Clip>(ref this.sortingArray, (count / 4 + ((count % 4 != 0) ? 1 : 2)) * 4);
                }
            }
            int num3 = 0;
            foreach (global::LightStylist.Clip clip in this.clips.Values)
            {
                if (clip.weight > 0f)
                {
                    this.sortingArray[num3++] = clip;
                }
            }
            if (this.clipsInSortingArray < num3)
            {
                this.clipsInSortingArray = num3;
            }
            else
            {
                while (this.clipsInSortingArray > num3)
                {
                    this.sortingArray[--this.clipsInSortingArray] = null;
                }
            }
            Array.Sort <global::LightStylist.Clip>(this.sortingArray, 0, this.clipsInSortingArray);
            float num4 = this.sortingArray[0].weight;
            a = this.sortingArray[0].simulation.BindMod(this._mask);
            for (int i = 1; i < this.clipsInSortingArray; i++)
            {
                global::LightStylist.Clip clip2 = this.sortingArray[i];
                num4 += clip2.weight;
                a     = global::LightStyle.Mod.Lerp(a, clip2.simulation.BindMod(this._mask), clip2.weight / num4, this._mask);
            }
            if (this._lightStyle)
            {
                global::LightStyle.Mod b = this.simulationIdle.BindMod(this._mask);
                if (num < 1f)
                {
                    a = global::LightStyle.Mod.Lerp(a, b, 1f - num, this._mask);
                }
                else
                {
                    a |= b;
                }
            }
        }
        foreach (Light light in this.lights)
        {
            if (light)
            {
                a.ApplyTo(light, this._mask);
            }
        }
    }