Пример #1
0
        /// <summary>
        /// Update
        /// </summary>
        /// <param name="camera">Camera</param>
        /// <param name="sun">Sun</param>
        /// <param name="moons">Moons</param>
        /// <param name="directionalLightIntensityModifiers">Directional light intensity modifiers</param>
        /// <param name="directionalLightShadowModifier">Directional light shadow modifiers</param>
        /// <param name="updateTimeOfDay">Whether to update the time of day</param>
        public void UpdateFromProfile
        (
            Camera camera,
            WeatherMakerCelestialObject sun,
            IList <WeatherMakerCelestialObject> moons,
            Dictionary <string, float> directionalLightIntensityModifiers,
            Dictionary <string, float> directionalLightShadowModifier,
            bool updateTimeOfDay)
        {
            float l = WeatherMakerScript.GetSunGradientLookup(camera, sun.Transform);

            UpdateAmbientColors(camera, sun.Transform, l);
            accumulatedTime += Time.deltaTime;
            if (accumulatedTime > UpdateInterval)
            {
                UpdateTimeOfDay(updateTimeOfDay);
                UpdateSun(camera, sun, l);
                UpdateDayMultipliers(camera, sun, l);
                UpdateMoons(camera, sun, moons);
                accumulatedTime = 0.0f;
            }
            UpdateLightIntensitiesAndShadows(sun, moons, directionalLightIntensityModifiers, directionalLightShadowModifier);
        }