private IEnumerator CoPlaytimeUpdate() { VolumetricLightBeam volumetricLightBeam = null; while (volumetricLightBeam.trackChangesDuringPlaytime && volumetricLightBeam.enabled) { volumetricLightBeam.UpdateAfterManualPropertyChange(); yield return(null); } volumetricLightBeam.m_CoPlaytimeUpdate = null; }
private IEnumerator CoPlaytimeUpdate() { VolumetricLightBeam volumetricLightBeam = this; while (volumetricLightBeam.trackChangesDuringPlaytime && ((Behaviour)volumetricLightBeam).get_enabled()) { volumetricLightBeam.UpdateAfterManualPropertyChange(); yield return((object)null); } volumetricLightBeam.m_CoPlaytimeUpdate = (Coroutine)null; }
// handle zoom logic private void updateZoom(float zoomAngle) { // set color of the material to a gradient between the colors as listed above Light[] lights = GetComponentsInChildren <Light>(); foreach (var light in lights) { VLB.VolumetricLightBeam beam = light.GetComponentInChildren <VLB.VolumetricLightBeam>(); light.spotAngle = zoomAngle; beam.UpdateAfterManualPropertyChange(); } }
// handle color changes // @REACH: true color wheel implementation private void UpdateColor(int c) { // set color of the material to a gradient between the colors as listed above Light[] lights = GetComponentsInChildren <Light>(); foreach (var light in lights) { VLB.VolumetricLightBeam beam = light.GetComponentInChildren <VLB.VolumetricLightBeam>(); // single color if (c < 128) { // set the color of the beam Color set = sharpyColor[c]; light.color = new Color(set.r, set.g, set.b, lightAlpha); beam.UpdateAfterManualPropertyChange(); // COMMENTED OUT: code for blending, but that's not what we really want //int colorIndex = c / 9; // which color a we're mixing; //int step = c % 9; // step between color a and b //float mix = step / 9f; // the mix between color a and b //// get the colors //Color a = sharpyColor[colorIndex]; //Color b; //// wrap around for color b //if (colorIndex < 14) // b = sharpyColor[colorIndex + 1]; //else // b = sharpyColor[0]; //// set the material's color //Color mixed = Color.Lerp(a, b, mix); //rend.material.color = new Color (mixed.r, mixed.g, mixed.b, 0.5f); //// may use this mixing instead if not satisfied with Lerp color mixing above //// Color mixed = LerpHSV(a, b, mix); //// rend.material.color = new Color (mixed.r, mixed.g, mixed.b, 0.5f); } // rotating color wheel else { // rotate colors } } }