Пример #1
0
        private void StartLightBlend(mset.Sky prev, mset.Sky next)
        {
            //get a list of lights and intensities from the sky we're blending away from
            prevLights      = null;
            prevIntensities = null;
            if (prev)
            {
                prevLights = prev.GetComponentsInChildren <Light>();
                if (prevLights != null && prevLights.Length > 0)
                {
                    prevIntensities = new float[prevLights.Length];
                    for (int i = 0; i < prevLights.Length; ++i)
                    {
                        prevLights[i].enabled = true;
                        prevIntensities[i]    = prevLights[i].intensity;
                    }
                }
            }

            nextLights      = null;
            nextIntensities = null;
            if (next)
            {
                nextLights = next.GetComponentsInChildren <Light>();
                if (nextLights != null && nextLights.Length > 0)
                {
                    nextIntensities = new float[nextLights.Length];
                    for (int i = 0; i < nextLights.Length; ++i)
                    {
                        nextIntensities[i]      = nextLights[i].intensity;
                        nextLights[i].enabled   = true;
                        nextLights[i].intensity = 0f;
                    }
                }
            }
        }