Exemple #1
0
    public void SetNewKey(IPianoKeyController previous, IPianoKeyController next)
    {
        previous.PianoKeyImage.color = previous.OriginalColor;
        Note currentNote = this.warmUp.GetCurrentNote();

        next.PianoKeyImage.color = currentNote.KeyColor;
    }
Exemple #2
0
    public IPianoKeyController[] GetAllPianoKeyController(IEnumerable <MonoBehaviour> btns)
    {
        List <IPianoKeyController> list = new List <IPianoKeyController>();

        foreach (MonoBehaviour btn in btns)
        {
            IPianoKeyController pkc = btn.GetComponent <IPianoKeyController>();
            list.Add(pkc);
        }
        return(list.ToArray());
    }
Exemple #3
0
    private void IPianoKeyController_RaiseKeyDown(object sender, KeyDownEventArg e)
    {
        IPianoKeyController pkc = e.pianoKeyCtrl;

        if (pkc == this.currentPianoKey)
        {
            IPianoKeyController previous = this.currentPianoKey;
            int temp = GetKeyIndex();
            this.currentPianoKey = this.pianoKeys[temp];
            this.warmUp.SetNewKey(previous, this.currentPianoKey);
        }
    }
Exemple #4
0
    public WarmUpContainer(IWarmUp warmUp)
    {
        this.warmUp    = warmUp;
        this.pianoKeys = GetAllPianoKeyController(this.warmUp.Keyboard);

        foreach (IPianoKeyController pkc in this.pianoKeys)
        {
            pkc.RaiseKeyDown += IPianoKeyController_RaiseKeyDown;
        }

        this.currentLesson = Save.DeserializeFromPlayerPrefs <Lesson> (ConstString.CurrentData);
        this.notes         = this.currentLesson.warmup.note;
        int temp = GetInitialIndex();

        this.currentPianoKey = this.pianoKeys[temp];
    }
Exemple #5
0
 public KeyDownEventArg(IPianoKeyController pianoKeyCtrl, Button button)
 {
     this.pianoKeyCtrl  = pianoKeyCtrl;
     this.currentButton = button;
 }
Exemple #6
0
 public PianoKey(IPianoKeyController pianoKey)
 {
     this.pianoKey = pianoKey;
     this.pitch    = this.pianoKey.Pitch;
 }