i have a little problem with the plugin im working on… if somebody finds a little time, that would be great.
the idea is to have a place to store values, assigned to an ID (an arbitrary string), whereas the values should have a binsize.
now, to do that, i created a dictionnary, with a spread of values assigned to the key (see code)
but there goes something wrong, the incoming values are assigned to all entries in the dictionnary although they should be only assigned the ones i ask for by an if-conditional…
please see the attached patch for a more detailed explanation.
i’m not sure if that’s the solution to your question, but try this:
// instead of d.Add(FSetID[i](i), FInputValue[i](i));
one entry in your dictionary stores a reference to the ISpread implementation, which is implemented with a double array whose lifetime is as long as that of your node. that array will be reused in next frame (if the slice count doesn’t grow much). since it is reused all your entries in your dictionary will basically point to the same array or ISpread. therefor you need to copy all the data in the ISpread when you decided to store them in a buffer. the extension method Clone() defined on ISpread does exactly that. hope that helps.