コード例 #1
0
    private void SetAllSounds()
    {
        sounds = GrandPianoController.GetSounds();

        soundsName       = new string[sounds.Length];
        grandPianoSounds = new AudioStreamPlayer2D[sounds.Length];
        for (int i = 0; i < sounds.Length; i++)
        {
            soundsName[i]       = sounds[i].Remove(0, 18);
            grandPianoSounds[i] = GetParent().GetNode <AudioStreamPlayer2D>(sounds[i]);
        }
    }
コード例 #2
0
    private void SearchSoundsFile()
    {
        playList = this.GetIndex();
        sounds   = GrandPianoController.GetAllSounds();

        GrandPiano = new AudioStreamPlayer2D[sounds.Length];

        for (int i = 0; i < sounds.Length; i++)
        {
            GrandPiano[i] = GetParent().GetParent().GetNode <AudioStreamPlayer2D>(sounds[i]);
        }
    }