public void ClearDatabase() { ListCharacteristicsRace.Clear(); ListCharacteristicsRace.Add(new CharacteristicsRace()); CurrentScriptableObjectsCR = ListCharacteristicsRace[0]; currentIndex = 0; }
public void AddElementToList() { if (ListCharacteristicsRace == null) { ListCharacteristicsRace = new List <CharacteristicsRace>(); } CurrentScriptableObjectsCR = new CharacteristicsRace(); ListCharacteristicsRace.Add(CurrentScriptableObjectsCR); currentIndex = ListCharacteristicsRace.Count - 1; }
public void RemoveCurrentElement() { if (currentIndex > 0) { CurrentScriptableObjectsCR = ListCharacteristicsRace[--currentIndex]; ListCharacteristicsRace.RemoveAt(++currentIndex); } else { ListCharacteristicsRace.Clear(); CurrentScriptableObjectsCR = null; } }
public CharacteristicsRace GetNextValue() { if (currentIndex < ListCharacteristicsRace.Count) { currentIndex++; } CountList = ListCharacteristicsRace.Count; if (currentIndex == CountList) { currentIndex = 0; } CurrentScriptableObjectsCR = this[currentIndex]; return(CurrentScriptableObjectsCR); }
public CharacteristicsRace GetPrevValue() { if (currentIndex > 0) { currentIndex--; } CurrentScriptableObjectsCR = this[currentIndex]; CountList = ListCharacteristicsRace.Count; if (currentIndex == 0) { currentIndex = CountList; } return(CurrentScriptableObjectsCR); }