Example #1
0
        // Go through all listed components and lerp overridden values in the global state
        void OverrideData(VolumeStack stack, List <VolumeComponent> components, float interpFactor)
        {
            foreach (var component in components)
            {
                if (!component.active)
                {
                    continue;
                }

                var state = stack.GetComponent(component.GetType());
                component.Override(state, interpFactor);
            }
        }
Example #2
0
        // Faster version of OverrideData to force replace values in the global state
        void ReplaceData(VolumeStack stack, List <VolumeComponent> components)
        {
            foreach (var component in components)
            {
                var target = stack.GetComponent(component.GetType());
                int count  = component.parameters.Count;

                for (int i = 0; i < count; i++)
                {
                    target.parameters[i].SetValue(component.parameters[i]);
                }
            }
        }