protected override LightStyle.Simulation ConstructSimulation(LightStylist stylist) { if (this.singletonSimulation == null) { } return(this.singletonSimulation = new DefaultSimulation(this)); }
public LightStyle.Simulation CreateSimulation(double startTime, LightStylist stylist) { LightStyle.Simulation simulation = this.ConstructSimulation(stylist); if (simulation != null) { simulation.ResetTime(startTime); } return(simulation); }
protected override LightStyle.Simulation ConstructSimulation(LightStylist stylist) { LightStyleDefault.DefaultSimulation defaultSimulation = this.singletonSimulation; if (defaultSimulation == null) { LightStyleDefault.DefaultSimulation defaultSimulation1 = new LightStyleDefault.DefaultSimulation(this); LightStyleDefault.DefaultSimulation defaultSimulation2 = defaultSimulation1; this.singletonSimulation = defaultSimulation1; defaultSimulation = defaultSimulation2; } return defaultSimulation; }
protected override LightStyle.Simulation ConstructSimulation(LightStylist stylist) { LightStyleDefault.DefaultSimulation defaultSimulation = this.singletonSimulation; if (defaultSimulation == null) { LightStyleDefault.DefaultSimulation defaultSimulation1 = new LightStyleDefault.DefaultSimulation(this); LightStyleDefault.DefaultSimulation defaultSimulation2 = defaultSimulation1; this.singletonSimulation = defaultSimulation1; defaultSimulation = defaultSimulation2; } return(defaultSimulation); }
protected override LightStyle.Simulation ConstructSimulation(LightStylist stylist) { return(new Simulation(this)); }
public Simulation CreateSimulation(LightStylist stylist) { return(this.CreateSimulation(time, stylist)); }
protected abstract Simulation ConstructSimulation(LightStylist stylist);
protected void LateUpdate() { float single; LightStyle.Mod mod; int num; 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 single1 = this.CalculateSumWeight(true, out single); if (single1 != 0f) { int count = this.clips.Count; if (this.clipsInSortingArray != count) { if (this.clipsInSortingArray > count) { while (this.clipsInSortingArray > count) { LightStylist lightStylist = this; int num1 = lightStylist.clipsInSortingArray - 1; num = num1; lightStylist.clipsInSortingArray = num1; this.sortingArray[num] = null; } } else if (this.sortingArray == null || (int)this.sortingArray.Length < count) { int num2 = count / 4; Array.Resize <LightStylist.Clip>(ref this.sortingArray, (num2 + (count % 4 != 0 ? 1 : 2)) * 4); } } int num3 = 0; foreach (LightStylist.Clip value in this.clips.Values) { if (value.weight <= 0f) { continue; } int num4 = num3; num3 = num4 + 1; this.sortingArray[num4] = value; } if (this.clipsInSortingArray >= num3) { while (this.clipsInSortingArray > num3) { LightStylist lightStylist1 = this; int num5 = lightStylist1.clipsInSortingArray - 1; num = num5; lightStylist1.clipsInSortingArray = num5; this.sortingArray[num] = null; } } else { this.clipsInSortingArray = num3; } Array.Sort <LightStylist.Clip>(this.sortingArray, 0, this.clipsInSortingArray); float single2 = this.sortingArray[0].weight; mod = this.sortingArray[0].simulation.BindMod(this._mask); for (int i = 1; i < this.clipsInSortingArray; i++) { LightStylist.Clip clip = this.sortingArray[i]; single2 = single2 + clip.weight; mod = LightStyle.Mod.Lerp(mod, clip.simulation.BindMod(this._mask), clip.weight / single2, this._mask); } if (this._lightStyle) { LightStyle.Mod mod1 = this.simulationIdle.BindMod(this._mask); mod = (single1 >= 1f ? mod | mod1 : LightStyle.Mod.Lerp(mod, mod1, 1f - single1, this._mask)); } } else { while (this.clipsInSortingArray > 0) { LightStylist lightStylist2 = this; int num6 = lightStylist2.clipsInSortingArray - 1; num = num6; lightStylist2.clipsInSortingArray = num6; this.sortingArray[num] = null; } if (!this._lightStyle) { return; } mod = this.simulationIdle.BindMod(this._mask); } Light[] lightArray = this.lights; for (int j = 0; j < (int)lightArray.Length; j++) { Light light = lightArray[j]; if (light) { mod.ApplyTo(light, this._mask); } } }
protected abstract LightStyle.Simulation ConstructSimulation(LightStylist stylist);
public LightStyle.Simulation CreateSimulation(double startTime, LightStylist stylist) { LightStyle.Simulation simulation = this.ConstructSimulation(stylist); if (simulation != null) { simulation.ResetTime(startTime); } return simulation; }
public LightStyle.Simulation CreateSimulation(LightStylist stylist) { return this.CreateSimulation(LightStyle.time, stylist); }