// You can override this to do your own blending. Either loop through the `parameters` list
        // or reference direct fields (you'll need to cast `state` to your custom type and don't
        // forget to use `SetValue` on parameters, do not assign directly to the state object - and
        // of course you'll need to check for the `overrideState` manually).
        public virtual void Override(VolumeComponent state, float interpFactor)
        {
            int count = parameters.Count;

            for (int i = 0; i < count; i++)
            {
                var stateParam = state.parameters[i];
                var toParam    = parameters[i];

                // Keep track of the override state for debugging purpose
                stateParam.overrideState = toParam.overrideState;

                if (toParam.overrideState)
                {
                    stateParam.Interp(stateParam, toParam, interpFactor);
                }
            }
        }
Exemplo n.º 2
0
        // You can override this to do your own blending. Either loop through the `parameters` list
        // or reference direct fields (you'll need to cast `state` to your custom type and don't
        // forget to use `SetValue` on parameters, do not assign directly to the state object - and
        // of course you'll need to check for the `overrideState` manually).
        public virtual void Override(VolumeComponent state, float interpFactor)
        {
            int count = parameters.Count;

            for (int i = 0; i < count; i++)
            {
                var stateParam = state.parameters[i];
                var toParam    = parameters[i];

                // Keep track of the override state for debugging purpose
//custom-begin: malte: allow partial overrides from many volumes in priority order
                if (toParam.overrideState)
                {
                    stateParam.overrideState = toParam.overrideState;
                    stateParam.Interp(stateParam, toParam, interpFactor);
                }
//custom-end

                if (toParam.overrideState)
                {
                    stateParam.Interp(stateParam, toParam, interpFactor);
                }
            }
        }