コード例 #1
0
    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);
    }
コード例 #2
0
 public void Play(MusicSymbol symbol, float fadeOutDuration = 1f, float position = 0f, float fadeInDuration = 0f)
 {
     if (symbol)
     {
         Play(MusicStore?.Get(symbol.name), fadeOutDuration: fadeOutDuration, position: position, fadeInDuration: fadeInDuration);
     }
     else
     {
         Play(default(Music), fadeOutDuration: fadeOutDuration);
     }
 }
コード例 #3
0
    public bool HasSymbol(MusicSymbol symbol)
    {
        char character = symbol.GetAttributeOfType <SymbolCharacterAttribute>().FontCharacter;

        return(IndicatorText.text.IndexOf(character) >= 0);
    }