Esempio n. 1
0
        private static Water.WeightedProfile[] CreateProfiles(List <WaterProfile> profiles, List <float> weights)
        {
            List <float> list  = WaterProfileBlend.NormalizeWeights(weights);
            int          count = profiles.Count;

            Water.WeightedProfile[] array = new Water.WeightedProfile[count];
            for (int i = 0; i < count; i++)
            {
                array[i] = new Water.WeightedProfile(profiles[i], list[i]);
            }
            return(array);
        }
Esempio n. 2
0
        private void OnProfilesChanged(Water water)
        {
            Water.WeightedProfile[] profiles = water.ProfilesManager.Profiles;
            if (profiles == null)
            {
                return;
            }
            float num = 0f;

            for (int i = profiles.Length - 1; i >= 0; i--)
            {
                Water.WeightedProfile weightedProfile = profiles[i];
                WaterProfileData      profile         = weightedProfile.Profile;
                float weight = weightedProfile.Weight;
                num += profile.PlanarReflectionIntensity * weight;
            }
            this._RenderPlanarReflections = (num > 0f);
        }