public void SetNewKey(IPianoKeyController previous, IPianoKeyController next) { previous.PianoKeyImage.color = previous.OriginalColor; Note currentNote = this.warmUp.GetCurrentNote(); next.PianoKeyImage.color = currentNote.KeyColor; }
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()); }
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); } }
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]; }
public KeyDownEventArg(IPianoKeyController pianoKeyCtrl, Button button) { this.pianoKeyCtrl = pianoKeyCtrl; this.currentButton = button; }
public PianoKey(IPianoKeyController pianoKey) { this.pianoKey = pianoKey; this.pitch = this.pianoKey.Pitch; }