public MusicSymbol[] PickSymbols(bool isCruel) { List <MusicSymbol> symbols = new List <MusicSymbol>(isCruel ? CruelSymbolOptions : NormalSymbolOptions); int symbolCount = isCruel ? CruelSymbolCount : NormalSymbolCount; IndicatorText.text = ""; MusicSymbol[] pickedSymbols = new MusicSymbol[symbolCount]; for (int symbolIndex = 0; symbolIndex < symbolCount; ++symbolIndex) { int listIndex = Random.Range(0, symbols.Count); MusicSymbol symbol = symbols[listIndex]; symbols.RemoveAt(listIndex); if (string.IsNullOrEmpty(IndicatorText.text)) { IndicatorText.text += symbol.GetAttributeOfType <SymbolCharacterAttribute>().FontCharacter; } else { IndicatorText.text += " " + symbol.GetAttributeOfType <SymbolCharacterAttribute>().FontCharacter; } pickedSymbols[symbolIndex] = symbol; } return(pickedSymbols); }
public bool HasSymbol(MusicSymbol symbol) { char character = symbol.GetAttributeOfType <SymbolCharacterAttribute>().FontCharacter; return(IndicatorText.text.IndexOf(character) >= 0); }