示例#1
0
 void NoteOff(int index)
 {
     if (synth)
     {
         synth.NoteOff(GetKeyFromIndex(index));
     }
     keys[index].SetOn(false);
 }
 void Update()
 {
     if (Input.GetMouseButtonDown(0))
     {
         controller.NoteOn(note);
     }
     if (Input.GetMouseButtonUp(0))
     {
         controller.NoteOff(note);
     }
 }
示例#3
0
        void Update()
        {
            int note = Random.Range(min, max);

            if (Random.Range(0.0f, 1.0f) < 0.5f)
            {
                player.NoteOn(note);
            }
            else
            {
                player.NoteOff(note);
            }
        }