void AdjustLight(KoreographyEvent evt, int sampleTime, int sampleDelta, DeltaSlice deltaSlice) { if (evt.HasIntPayload()) { if (evt.GetIntValue() == 1) { lights[0].SetActive(true); lights[1].SetActive(true); lights[2].SetActive(false); lights[3].SetActive(false); } else if (evt.GetIntValue() == 2) { lights[0].SetActive(false); lights[1].SetActive(false); lights[2].SetActive(true); lights[3].SetActive(true); } else if (evt.GetIntValue() == 3) { lights[0].SetActive(true); lights[1].SetActive(true); lights[2].SetActive(true); lights[3].SetActive(true); } else { lights[0].SetActive(false); lights[1].SetActive(false); lights[2].SetActive(false); lights[3].SetActive(false); } } }
private void HandleTrackEvent(KoreographyEvent ev, TrackType track) { if (this.canMoveToNextSection || track != this.currentFocusedTrack) { return; } var value = ev.HasIntPayload() ? ev.GetIntValue() : -1; if (value > this.GetCurrentMinNoteValue()) { return; } OnTrackNoteEvent(track, value); }
public void GenerateKey(KoreographyEvent koreographyEvent) { lightManager.ChangeLightColors(); // asignar un color random por ahorita if (koreographyEvent.HasIntPayload()) { if (koreographyEvent.GetIntValue() == (int)KoreoInts._1_GenerateRandomKey) { if (keyEvents.Contains(koreographyEvent)) { Debug.Log("Se encontro!"); for (int i = 0; i < keyEventsLength; i++) { //si empiezan en el mismo tiempo es que son el mismo if (keyEvents[i].StartSample == koreographyEvent.StartSample) { if (i + 1 < keyEventsLength) { keyManager.GenerateRandomKey(koreographyEvent.EndSample, keyEvents[i + 1].StartSample, koreography.SampleRate); } else { keyManager.GenerateRandomKey(koreographyEvent.EndSample, 0, koreography.SampleRate, true); } break; } } } else { Debug.Log("No se encontro ):"); } } else if (koreographyEvent.GetIntValue() == (int)KoreoInts._2_SondEnded) { //Se acabo el juego keyManager.GameWon(); } Debug.Log(koreographyEvent.GetIntValue()); } }
private void HandleBeatTrackEvent(KoreographyEvent ev) { var moveToNextMeasure = ev.HasIntPayload() && ev.GetIntValue() >= 0; if (moveToNextMeasure) { this.currentBeat = 0; this.currentMeasure++; this.OnMeasureChange(this.currentMeasure); } else { this.currentBeat++; } if (!this.canMoveToNextSection) { this.currentScoreBeat++; this.OnScoreBeat(this.currentScoreBeat); } var lengthInMeasures = (int)Koreographer.Instance.GetMusicBeatLength(this.currentFocusedTrack.ToString()) / 4; var measureProgress = 0; if (lengthInMeasures > 0) { measureProgress = this.currentMeasure % lengthInMeasures; } if (this.currentBeat == 0 && measureProgress == 0 && this.canMoveToNextSection) { this.currentSection++; this.StartSection(); } }