Hi Guys, simple question. I have a list (or it could also be an array) in my inspector.
public List<float> intList;
or
public float[] floatArray;
I can have as many elements in each list or array as I like, but the constraint is that the numeric sum of all element values in the array must always be 10.0
So lets say if my list (or array) had 3 elements, each with the values:
[0] = 3.0
[1] = 5.0
[3] = 2.0
If i adjust element [3] to have a value of 10.0, I need to do some calculation and reduce both [0] and [1] to value of 0.0… because the sum of all elements must always be equals to 10.0 ! (Sum of element values, not count of elements!!!)
The problem is not the calculation, but how do i detect that an element value was changed in order to run some custom code to repopulate the values in other elements?
Thanks
Kevin