private bool _IsRandomItemMode(SoundPickSubItemMode audioPickSubItemMode) { switch (audioPickSubItemMode) { case SoundPickSubItemMode.Random: return(true); case SoundPickSubItemMode.RandomNotSameTwice: return(true); } return(false); }
public SoundSubItem[] ChooseSubItems(SoundPickSubItemMode pickMode) { if (subItems == null) { return(null); } int arraySize = subItems.Length; if (arraySize == 0) { return(null); } int chosen = 0; SoundSubItem[] chosenItems; if (arraySize > 1) { switch (pickMode) { case SoundPickSubItemMode.Disabled: return(null); case SoundPickSubItemMode.Random: chosen = ChooseRandomSubitem(true); break; case SoundPickSubItemMode.RandomNotSameTwice: chosen = ChooseRandomSubitem(false); break; } } lastChosen = chosen; chosenItems = new SoundSubItem[1]; chosenItems[0] = subItems[chosen]; return(chosenItems); }