Also replaced ContactRegister array with a Switch Expression. After 5 distinct items, a Switch Statement or Switch Array is implemented as a hash table lookup. This avoids a couple of if statements, and also makes clear where there are gaps.
Also replaced Matrix3x2.Invert with custom code, again avoiding if statements. This is 10-15% faster than using Matrix3x2.Invert.
Also replaced ContactRegister array with a Switch Expression. After 5 distinct items, a Switch Statement or Switch Array is implemented as a hash table lookup. This avoids a couple of if statements, and also makes clear where there are gaps. Also replaced Matrix3x2.Invert with custom code, again avoiding if statements. This is 10-15% faster than using Matrix3x2.Invert.