public void ForwardButton(string selectionType) { indexLength = loadAssets.GetCount(selectionType) - 1; if (currentIndex[selectionType] < indexLength) { currentIndex[selectionType]++; } else { currentIndex[selectionType] = 0; } SetSelectionText(selectionType, loadAssets.GetName(selectionType, currentIndex[selectionType])); }
void Start() { loadAssets = GetComponent <LoadAssets>(); foreach (KeyValuePair <string, int> selectionType in currentIndex) { SetSelectionText(selectionType.Key, loadAssets.GetName(selectionType.Key, currentIndex[selectionType.Key])); } }