The blow code:
|
_inputInterfaces.Add(inputInterface); |
for (int i = numInterfaces - 1; i >= 0; i--) { if (_inputInterfaces[i] != null && _inputInterfaces[i].Priority <= inputInterface.Priority) { _inputInterfaces.Add(inputInterface); //Debug.LogFormat("Registered {0} at {1}. Total of {2}", inputInterface.GetType(), i, _inputInterfaces.Count); break; } }
The inputInterface seems always added into the last but add to the index i?